Quotes in a string

G

Guest

I have the following string I need to add into a query.
(tblGBREPORT.StartTime)>=08.30 And (tblGBREPORT.StartTime)<=09.30

but for it to work I assume that I need quotes round the times. How do I
insert the quotes without VB thinking that the first quote is the end of the
string definition.

Thanks
Graham
 
K

Ken Snell [MVP]

Times are delimited by the # character:

(tblGBREPORT.StartTime)>=#08.30# And (tblGBREPORT.StartTime)<=#09.30#
 
S

Steve Schapel

Graham,

In addition, you might want to check that a . rather than a : is the
applicable time separator. Maybe it should be...
(tblGBREPORT.StartTime)>=#08:30# And (tblGBREPORT.StartTime)<=#09:30#

By the way, I would personally prefer this syntax...
(tblGBREPORT.StartTime) Between #08:30# And #09:30#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top