G
Guest
Greetings.
I am building a query to return all records between dates selected
by the user.
When I use the following code to build my query, the date selection
works correctly:
stmtSQL = stmtSQL & " AND (DateValue([Alarm Time]) + TimeValue([Alarm
Time]) BETWEEN '" _
& Me.dtpFromDate & "' AND '" _
& Me.dtpToDate & "')"
But when I try to simply things by using the following code, the
query fails.
stmtSQL = stmtSQL & " AND ([Alarm Time] BETWEEN '" _
& Me.dtpFromDate & "' AND '" _
& Me.dtpToDate & "')"
Although the first solution works, it seems a little kludgy to me.
Isn't there a simpler way than splitting apart the DateValue and
TimeValue of [Alarm Time] to make this query work?
Regards,
Charles
I am building a query to return all records between dates selected
by the user.
When I use the following code to build my query, the date selection
works correctly:
stmtSQL = stmtSQL & " AND (DateValue([Alarm Time]) + TimeValue([Alarm
Time]) BETWEEN '" _
& Me.dtpFromDate & "' AND '" _
& Me.dtpToDate & "')"
But when I try to simply things by using the following code, the
query fails.
stmtSQL = stmtSQL & " AND ([Alarm Time] BETWEEN '" _
& Me.dtpFromDate & "' AND '" _
& Me.dtpToDate & "')"
Although the first solution works, it seems a little kludgy to me.
Isn't there a simpler way than splitting apart the DateValue and
TimeValue of [Alarm Time] to make this query work?
Regards,
Charles