3 replies
by shurt Accepted solution
by Former member Accepted solution
Access Date Functions
This list gives a brief description of the most useful date functions in Access. Access Help gives more details and will describe exactly how these functions operate in your version of Access.
Note that functions are always followed by a pair of brackets even if - like Date() - there's nothing in them. The Access editor will sometimes remove these brackets but by entering them you are telling Access that you are attempting to use a function.
Date()
Gives today's date. Date$() gives it as a string. There is also a Date command which sets the system date.
Day()
Gives the day of the month (1 .. 31) of .
DateAdd(,,)
Adds an interval to . The intervals can be anything from seconds to years.
DateDiff(, , )
Subtracts from and gives the result in the unit specified as .
DatePart(, )
Extracts part of , for example the minute, week or quarter.
Format(, )
Returns as a text string in the format specified.
Hour()
Returns the hour of as a number from 0 to 23.
Minute()
Returns the minute of as a number from 0 to 59.
Month()
Returns the month number of .
Now()
Returns the current date and time.
Second()
Returns the second of as a number from 0 to 59.
Time()
Returns the current time. Time$()gives it as a string. There is also a Time command which sets the system time.
WeekDay()
Gives the day of the week as a number from 1 to 7.
Year()
Returns the year number of .
Please post back if you have any more problems or questions.
by tony hopkinson Accepted solution
Select * from MyTable
Where
DateDiff(hour,Date(),MyDateField) < 24
should give you a start.
It's the number of whole hours though, so
DateDiff(minute,Date(),MyDateField) < (24 * 60), might do you better.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending