Can anyone point me to some kind of reference which points out the ground rules for the SQL syntax in an SQL string in Visual basic. It obviously differs from that you see in the SQL view of a standard Access Query grid.
The Access help function only has limited examples it would seem. My current problem is trying to resolve an SQL string which calculates two Between statements as follows -
Forms![Bookings]![Bookings - Subform 1]![Start Time].RowSource = "SELECT [Start Time] FROM Periods WHERE [Start Time] NOT BETWEEN " & Periods(1, 1) & " AND " & Periods(1, 2) & " AND [Start Time] NOT BETWEEN " & Periods(2, 1) & " AND " & Periods(2, 2) & ""
Currently this is giving me a syntax error, but if I have only one Between statement it works fine, ie
Forms![Bookings]![Bookings - Subform 1]![Start Time].RowSource = "SELECT [Start Time] FROM Periods WHERE [Start Time] NOT BETWEEN " & Periods(1, 1) & " AND " & Periods(1, 2) & ""
Must be some missing brackets or something but I have tried many variations.
help appreciated!
The Access help function only has limited examples it would seem. My current problem is trying to resolve an SQL string which calculates two Between statements as follows -
Forms![Bookings]![Bookings - Subform 1]![Start Time].RowSource = "SELECT [Start Time] FROM Periods WHERE [Start Time] NOT BETWEEN " & Periods(1, 1) & " AND " & Periods(1, 2) & " AND [Start Time] NOT BETWEEN " & Periods(2, 1) & " AND " & Periods(2, 2) & ""
Currently this is giving me a syntax error, but if I have only one Between statement it works fine, ie
Forms![Bookings]![Bookings - Subform 1]![Start Time].RowSource = "SELECT [Start Time] FROM Periods WHERE [Start Time] NOT BETWEEN " & Periods(1, 1) & " AND " & Periods(1, 2) & ""
Must be some missing brackets or something but I have tried many variations.
help appreciated!