I read through the parts of the manual that applied
but I might be missing something here.

I have a table where I'm trying to query the date with
a conditional statement.  As you'll see , if 3 was the
condition then the statement should result in a list
of any entries made <= current date.  

It just is not working.

Entry_Table:
EntriesID (int)
EntryDte  (date)
.....(irrelevant fields).....

Second table (created just for query since this is
going into a web app)
CountBack_Table
CountBackID (int)
CountBack (int)
Then the records in the table are 
CountBackID = 30 , CountBack = 30
CountBackID = 21, CountBack = 21
CountBackID = 7, CountBack = 7
.............(few more)...........

I thought my statement should be like this: 
Select
Entry_Table.EntryDte,CountBack_Table.CountBackID
>From Entry_Table, CountBack_Table
if CountBackID = 1
then
Date_Sub(Curdate(), interval 1 day) <= EntryDte
elseif CountBackID = 3
then
Date_Sub(Curdate(), interval 3 day) <= EntryDte
.......................etc. 


I'm not sure if the "if CountBackID" is wrong.  Can I
not use the value in the record, or perhaps I'd need
to define a user variable?

Thank you,
Stuart

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to