A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date format in query



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2006, 04:46 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date format in query

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
  #2  
Old February 23rd, 2006, 06:25 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date format in query

Sandy wrote:
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

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Average cutthroatjess Running & Setting Up Queries 17 December 19th, 2005 07:52 PM
Date format in crosstab query Matt Running & Setting Up Queries 3 September 12th, 2005 07:32 AM
DATE FORMAT in crosstab query Mary Running & Setting Up Queries 2 February 18th, 2005 03:31 PM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Aggregating Date Data into Weeks and Quarters Roger Running & Setting Up Queries 3 July 11th, 2004 05:56 PM


All times are GMT +1. The time now is 07:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.