Steve,

First and foremost, your logic is wrong. I think you have confused yourself by putting 
the column left of the operator in one condition, and the column right of the operator 
in the other condition. You are asking for rows where the timestamp is both >= 
january first 2004 and the timestamp is also >= december 1, 2004.  All rows that 
match the second condition also match the first condition.

Other tips:

Make sure your Oterro default date format matches your Witango.cfg default date 
format, or else force them to match in your query.

When you use single quotes around a date value with R:Base or Oterro, you can 
also compare them to a datetime directly.  e.g.:

b2.b_timestamp >= '01/01/2004'

b2.b_timestamp <= '12/02/2004'

You can use <@SQ> for the quote marks in your direct dbms to make sure that they 
won't be doubled through SQL encoding. Either that, or be sure your encoding=none, 
so that those quotes surrounding a date or date/time value are not doubled.

Bill

On 31 May 2004 at 9:35, Claudine Robbins wrote:

> Since you asked for ideas and not solutions, how about using BETWEEN
> value1 AND value2?  Also, you need to match the date and time format
> to the actual data or change the format before your select statement
> SET DATE FOR, SET TIME FOR...
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Fogelson, Steve Sent: Wednesday, March 17, 2004 12:01 PM To: RBASE-L
> Mailing List Subject: [RBASE-L] - [No Subject]
> 
> Windows 3002 Web Edition, R:Tango 5, Oterro update 3
> 
> Can't figure out what is wrong with the following DBMS action:
> 
>  SELECT B2.B_ID, B2.B_ShopperID, P1.P_Name, B2.B_Quantity,
>  P1.P_Price1,
> B2.B_TimeStamp FROM Products P1, Basket B2 WHERE ((P1.P_ID=B2.P_ID)
> AND ( (b2.B_TimeStamp >= '2004/01/01 00:00:01') and ('2004/12/01
> 23:23:59' <= b2.B_TimeStamp) ))
> 
> 2418 [RBTI][Oterro ODBC Driver][Catalog]-ERROR- Invalid DATETIME value
> (2418) S1000 
> 
> I have tried 2004/12/01, 12/01/2004, 12/01/2004 23:23:59. Nothing
> seems to work. 
> 
> b2.B_TimeStamp is a field with the Timestamp Datatype.
> 
> Any ideas?
> 
> Steve Fogelson
> Internet Commerce Solutions
> 
> --- RBASE-L
> ================================================
> TO POST A MESSAGE TO ALL MEMBERS:
> Send a plain text email to [EMAIL PROTECTED]
> 
> (Don't use any of these words as your Subject:
> INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
> REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message SUBJECT, put just one word: INTRO
> ================================================
> TO UNSUBSCRIBE: 
> Send a plain text email to [EMAIL PROTECTED]
> In the message SUBJECT, put just one word: UNSUBSCRIBE
> ================================================
> TO SEARCH ARCHIVES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message SUBJECT, put just one word: SEARCH-n
> (where n is the number of days). In the message body, 
> place any 
> text to search for.
> ================================================

Reply via email to