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
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