Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Queries

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-30-2009, 04:50 AM
kbsudhir kbsudhir is offline Windows Vista Access 2003 (version 11.0)
Novice
 
Join Date: Apr 2009
Posts: 1
kbsudhir is on a distinguished road
Question Time Query

Hi All,

I am using Access 2003. I have a table with "DateTime" Field.

This field captures the received date n Time for teh incoming mails in by outlook in the belwo format:

"6/29/2009 3:30:12 PM".

Now I want to create a query to pull the deadline from this column. It pull those records which have date of today & time is for after "4Hrs"

Ex. if its 4:00AM in then it pull data for todays date till the time is "<=8:00AM".

Please guide.

Any assitance is appreciated.

Regards

Reply With Quote
  #2  
Old 07-06-2009, 03:19 AM
kevsparky kevsparky is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jul 2009
Posts: 4
kevsparky is on a distinguished road
Default

Access stores dates as whole numbers and times as fractions of a day. See here for details http://support.microsoft.com/kb/210276.

If you want to get a time 4hrs in the future, you can use DateTime + (4/24) this is 4 hours as a fraction of a day.

If you want to get 8AM on a certain day, use Int(DateTime) + (8/24) the Int function just returns the integer part of a variable.

Or you can google "Access DateDiff()" or "Access DateAdd()" functions for syntax and info.
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.