LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Query on Date range does not qualify the Year

I have a query that pulls data based on a date range. The data that comes
out is correct based on the Month and Day values, however the year seems to
not factor into the query. For instance, I am looking at dates from years
2005 and 2004. If my query looks for 06/01/2005 thru 07/01/2005, I receive
results from 06/01 thru 07/01 from both 2004 and 2005.

Here is what my query looks like:

BeginDate = Format(Date, "mm/dd/yyyy")
EndDate = Format(DateAdd("d", 14, BeginDate), "mm/dd/yyyy")

SQL = "SELECT reqdate, Customer FROM [detail$] WHERE (reqdate = '" & _
BeginDate & "') AND (reqdate <= '" & EndDate & "') ORDER BY reqdate"


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a date range contains a leap year (date) Rebecca_SUNY Excel Worksheet Functions 14 July 5th 08 11:46 AM
compute count of range of date fields with a given year Excel formula Excel Discussion (Misc queries) 1 November 28th 07 11:25 PM
Locate month n year from range of date Rao Ratan Singh New Users to Excel 1 March 2nd 06 09:13 AM
Locate month and year from range of date from another sheet Rao Ratan Singh New Users to Excel 3 March 1st 06 07:55 AM
MS Query - STANDARD DATE to YEAR-MONTH papegoja Excel Programming 1 October 14th 03 07:20 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"