Dennis,
I sent this one off the David yesterday (well it was yesterday to me but the day before to you I think ha ha) anyway I have seen this occure even back in 2.11 and I have always used the CTXT and it seems to work just fine.
SEL * FROM TESTTIME WHERE (CTXT(TESTTIME)) = .vTime
Tony
Brisbane Australia
----- Original Message -----From: Dennis McGrathSent: 01 December 2002 09:07To: [EMAIL PROTECTED]Subject: RE: Time format/Sequence challenge?David,
I created a test to find out:
SET TIME FOR HHMM AP
SET TIME SEQ HHMM
SET VAR vTime = '1145'
SEL * FROM TESTTIME
1145 AM
1145 PM
SEL * FROM TESTTIME WHERE TESTTIME = .vTime
1145 AM
SEL * FROM TESTTIME WHERE TESTTIME = (.vTime)
-ERROR- Column TESTTIME must be compared to TIME values.
This may shed some light on the subject. Seems that when the interpreter
looks at an expression it reads the time variable using the time FORMAT
instead of converting the value to 24 hour time which be unambiguous and
never fail.
There is a similar issue with dates. With dates I can use the FORMAT()
function to force date values in expressions to four digit years which are
unambiguous. Unfortunately FORMAT() does not work with time values, so one
has to find other solutions.
In any case, this demo should help point to a workaround.
--Dennis McGrath
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David M. Blocker
Sent: Saturday, November 30, 2002 1:02 PM
To: [EMAIL PROTECTED]
Subject: Re: Time format/Sequence challenge?
Dennis
Any ideas on the original question, about why the query fails when time
format is set to HH:MM AP?
David Blocker
----- Original Message -----
From: "Dennis McGrath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 30, 2002 10:25 AM
Subject: RE: Time format/Sequence challenge?
> The rsyntax SET TIME point to the docs for the time data type.
>
> I have submitted the boo-boo to RDCC.
>
> Her is the correct syntax:
>
> SET TIME FOR HH:MM AP
> SET TIME SEQ HHMM
>
> No quotes are needed as the interpreter is smart enough to know that the
> TIME FOR setting may need a space.
>
> Now you can enter time as follows:
> 11:45PM will be displayed as 11:45 PM
> 1145PM will be displayed as 11:45 PM
> 1145 will be displayed as 11:45 AM
> 11PM will be displayed as 11:00 PM
> 11AM will be displayed as 11:00 AM
> 11 will be displayed as 11:00 AM
> 1356 will be displayed as 1:56 PM
>
> you could also do:
> SET TIME FOR HHMM AP
> SET TIME SEQ HHMM
> or
> SET TIME FOR HHMMAP
> SET TIME SEQ HHMM
>
> Hope this helps.
>
> --Dennis McGrath
>
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Nicky Avery
> Sent: Saturday, November 30, 2002 3:22 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Time format/Sequence challenge?
>
>
> Claudine Robbins wrote:
>
> >Well, it doesn't work anyway. I tried the SET TIME HH:MM AP and it
> >gives an "invalid command" error,
> >
>
> Claudine,
>
> SET TIME is insufficient. It's necessary to specify the SEQ and FOR
> separately and, I believe, to use AP, put the setting param in quotes
>
> RBHelp: "If the format contains spaces or commas, enclose the format in
> quotes."
>
>
> e.g:
>
> SET TIME SEQ 'HHMM AP'
>
> but using the above means that time has also to be entered in quotes
> with a following AM or PM for correct results - a 24-hour clock
> (military time) is much simpler.
>
> SET TIME FOR 'HH:MM AP'
>
>
> David,
>
> Would the quotes make your code work in the desired way?
>
> Nicky
>
>
>
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
