Aug 22nd, 2000, 10:12 AM
The SQL statement should select only those recordsets where the month matches the month selected:
SELECT DateBegin, DateEnd, PTS1A, PTS1C, PTS2A, PTS2C, PTS3A, PTS3C, MeetBF, MeetEm, MeetIn, MeetPl, GroupName FROM MeetingPTS WHERE DateBegin LIKE '07/%/2000' OR '08/%/2000' ORDER BY [DateBegin] ASC
However it fails, returning all records as if I had written:
SELECT * FROM MeetingPTS
Where did I miscode? I thought the '%' acted as a wildcard?
All fields in the Db are strings, even those as dates.
Thanks!
Note: I figured it out. It seems that while VB will accept "A = 0 OR 3", SQL is less forgiving of implied meanings. So for SQL the statement would be "A = 0 OR A = 3"
I needed to rewrite the query as:
DateBegin LIKE '07/%/2000' OR DateBegin LIKE '08/%/2000'
[Edited by nbtnad6 on 08-22-2000 at 03:02 PM]
SELECT DateBegin, DateEnd, PTS1A, PTS1C, PTS2A, PTS2C, PTS3A, PTS3C, MeetBF, MeetEm, MeetIn, MeetPl, GroupName FROM MeetingPTS WHERE DateBegin LIKE '07/%/2000' OR '08/%/2000' ORDER BY [DateBegin] ASC
However it fails, returning all records as if I had written:
SELECT * FROM MeetingPTS
Where did I miscode? I thought the '%' acted as a wildcard?
All fields in the Db are strings, even those as dates.
Thanks!
Note: I figured it out. It seems that while VB will accept "A = 0 OR 3", SQL is less forgiving of implied meanings. So for SQL the statement would be "A = 0 OR A = 3"
I needed to rewrite the query as:
DateBegin LIKE '07/%/2000' OR DateBegin LIKE '08/%/2000'
[Edited by nbtnad6 on 08-22-2000 at 03:02 PM]