Minus Date

Gismo

Registered User.
Local time
Today, 21:37
Joined
Jun 12, 2017
Messages
1,298
Hi,

How do I calculate in a query to subtract 12 days from a date (YYYY/MM/DD) ?
 
DateAdd("d",-12, Date())

or

DateAdd("d",-12, [dateField])
 
You could use DateSerial. Something like


Code:
=DateSerial(Year([StartDate]),Month([StartDate]),Day([StartDate])-12)
 
or just

Date()-12

or

[myateField]-12
 
Hi, sorry, I meant to as for -12 months, not days
 
Use arnel's code from post 2 but use "m" instead of "d"
 
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
 

Users who are viewing this thread

Back
Top Bottom