Date format in query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello -

I have a date column that is populated with "Now()" (Date and time). I want
to write a query that Deletes all records where the date is today's date and
certain fields are blank; in other words, strip the time off of the DateTime
column and only use the date.

How do I do that?
 
Sandy said:
I have a date column that is populated with "Now()" (Date and time). I want
to write a query that Deletes all records where the date is today's date and
certain fields are blank; in other words, strip the time off of the DateTime
column and only use the date.


Use the DateValue function to extrace the date from a
date/time value.

DELETE *
FROM thetable
WHERE DateValue(datefield) = Date()
AND thisfield Is Null
AND thatfield Is Null
 
Back
Top