Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Date Quuery

Status
Not open for further replies.

Sheriff

Programmer
Sep 1, 2001
34
US
I'm having a proplem with Query for access with vb6. The Query returns records that are the range but the year is off. example if sBeginDate = "01/01/02" and sEndDate = "03/31/02" the records also include 01/01/01 as well as 01/01/02
I am using the MS MaskEdit control to input the date

This is the query:

MySql = "SELECT [Services].[AccID], [Services].[InstRprD], [Services].[Brand], [Services].[AptNo], [Services].[InModel], [Services].[InSerial], [Services].[OutModel], [Services].[OutSerial], [Services].[Warranty], [Services].[Amount]"
MySql = MySql & " FROM Services"
MySql = MySql & " WHERE Services.InstRprD Between " & Chr(34) & sBeginDate & Chr(34) & " And " & Chr(34) & sEndDate & Chr(34)

MySql = MySql & " ORDER BY [Services].[InstRprD]"
Set rsSer = db.OpenRecordset(MySql, dbOpenDynaset)

Any help would be greatly appreciated
Thanks in advance
Sheriff


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top