Jumat, 25 September 2015

RE: [MS_AccessPros] How to check if a date is among (belong to) a time interval?

 

Hi Kevin

The SQL construction you are looking for is BETWEEN … AND

For your example, you would say:

WHERE [YourDateField] between #2016-01-05# AND #2016-01-20#

There are a limited number of date formats that are permitted between the # delimiters.  One is the standard American format (mm/dd/yyyy) but I prefer to use yyyy-mm-dd because it is not ambiguous.

Best wishes,
Graham

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Saturday, 26 September 2015 00:00
To: MS_Access_Professionals <ms_access_professionals@yahoogroups.com>
Subject: [MS_AccessPros] How to check if a date is among (belong to) a time interval?

 

 

Dear All,

 

How to check if a date is among (belong to) a time interval?

 

For instance, how to check if 05-Jan-2016 is among "01-Jan-2016 to 20-Jan-2016". My desired output would be, if the finding is yes, returns a value "True", otherwise returns "False". 

 

Best Regards,

Kevin

 


Regards,

Kevin Zhao

__._,_.___

Posted by: "Graham Mandeno" <graham@mandeno.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar