List:General Discussion« Previous MessageNext Message »
From:Stuart Felenstein Date:September 13 2004 2:23pm
Subject:HelpPlease: Conditional loop confusion
View as plain text  
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
Thread
HelpPlease: Conditional loop confusionStuart Felenstein13 Sep
  • Re: HelpPlease: Conditional loop confusionSGreen13 Sep
    • Re: HelpPlease: Conditional loop confusionStuart Felenstein13 Sep
      • Re: HelpPlease: Conditional loop confusionSGreen13 Sep
        • Re: HelpPlease: Conditional loop confusionStuart Felenstein13 Sep
          • Error 2013Emmett Bishop13 Sep
            • RE: Error 2013Dathan Vance Pattishall13 Sep
          • Re: HelpPlease: Conditional loop confusionSGreen13 Sep
            • Re: HelpPlease: Conditional loop confusionStuart Felenstein13 Sep
              • Re: HelpPlease: Conditional loop confusionSGreen13 Sep
                • Re: HelpPlease: Conditional loop confusionStuart Felenstein14 Sep
              • Re: HelpPlease: Conditional loop confusionHarald Fuchs14 Sep
                • Re: HelpPlease: Conditional loop confusionStuart Felenstein14 Sep
                  • HelpPlease:Urgentbiswa\(global\)14 Sep
                • Re: HelpPlease: Conditional loop confusionHarald Fuchs14 Sep
                • Re: HelpPlease: Conditional loop confusionSGreen14 Sep
                • Re: HelpPlease: Conditional loop confusionHarald Fuchs14 Sep
                  • Connections and PoolingJeff Demel14 Sep
                    • Re: Connections and PoolingSGreen14 Sep
                  • Re: HelpPlease: Conditional loop confusionStuart Felenstein14 Sep