Hi All

I have this Select statement that access some date field that I use to access
an Access Database. This statement works fine.

cmdstring = "SELECT shft, datevalue(#" & NowDate & "#) + adjust_nr FROM shift_tm
where #" & _
NowTime & "# between start_tm and end_tm"

But then, my program should not only access MS Access Database but it should
also be able to access SQL Server database as well.
So when I execute my program, it prompts me error for the above statement.
Error is:-

Incorrect syntax near '#'.

Can anyone suggest a statement that works for both the Access Database as
well as the SQL Server database.