Hi, How do I calculate in a query to subtract 12 days from a date (YYYY/MM/DD) ?
G Gismo Registered User. Local time Today, 18:52 Joined Jun 12, 2017 Messages 1,298 Sep 6, 2018 #1 Hi, How do I calculate in a query to subtract 12 days from a date (YYYY/MM/DD) ?
arnelgp ..forever waiting... waiting for jellybean! Local time Today, 23:52 Joined May 7, 2009 Messages 19,230 Sep 6, 2018 #2 DateAdd("d",-12, Date()) or DateAdd("d",-12, [dateField])
T theseus Registered User. Local time Today, 11:52 Joined Aug 6, 2018 Messages 32 Sep 6, 2018 #3 You could use DateSerial. Something like Code:Copy to clipboard =DateSerial(Year([StartDate]),Month([StartDate]),Day([StartDate])-12)
You could use DateSerial. Something like Code:Copy to clipboard =DateSerial(Year([StartDate]),Month([StartDate]),Day([StartDate])-12)
C CJ_London Super Moderator Staff member Local time Today, 16:52 Joined Feb 19, 2013 Messages 16,605 Sep 6, 2018 #4 or just Date()-12 or [myateField]-12
G Gismo Registered User. Local time Today, 18:52 Joined Jun 12, 2017 Messages 1,298 Sep 7, 2018 #5 Hi, sorry, I meant to as for -12 months, not days
isladogs MVP / VIP Local time Today, 16:52 Joined Jan 14, 2017 Messages 18,211 Sep 7, 2018 #6 Use arnel's code from post 2 but use "m" instead of "d"
C CJ_London Super Moderator Staff member Local time Today, 16:52 Joined Feb 19, 2013 Messages 16,605 Sep 7, 2018 #7 or use "yyyy" and -1 @Theseus - don't think your code would work if startdate was say 3rd of month, Day(Startdate)-12 would give you -9
or use "yyyy" and -1 @Theseus - don't think your code would work if startdate was say 3rd of month, Day(Startdate)-12 would give you -9