A whole lot of context would be very useful in helping us understand your issue:
What is the purpose of the Entry_Table table? What were you trying to accomplish with the CountBack_Table table? What were the intended purpose and the expected results of the query that you couldn't write? How does your query have any bearing on "conditional loops"? Please don't rush your explanations. Thanks, Shawn Green Database Administrator Unimin Corporation - Spruce Pine Stuart Felenstein <[EMAIL PROTECTED]> wrote on 09/13/2004 10:23:27 AM: > 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] >