Multiple conditions-----> If Aantal >=

Results 1 to 3 of 3

Thread: Multiple conditions-----> If Aantal >=

  1. #1
    Davy Wagenmakers Guest

    Default Multiple conditions-----> If Aantal >=

    When I use this code the IF then does not do its work<BR>and it are all integers type (number) in the database<BR>why can´t it read/compare 2 values?????<BR><BR>Please help<BR><BR><BR>Aantal = 50<BR><BR>Query4 = "SELECT * FROM Bundel WHERE (" & Prijs & " BETWEEN Prijsmin AND Prijsmax) AND (BundelID &#060;&#062; 0)"<BR>Set Bundel = Connect.Execute(Query4)<BR> <BR> BA = Bundel("A")<BR> BB = Bundel("B")<BR> BC = Bundel("C")<BR> BD = Bundel("D")<BR> BE = Bundel("E")<BR> BF = Bundel("F")<BR><BR> If Aantal &#062;= BA AND Aantal &#060; BB then<BR> Response.Write "a"<BR> ElseIf Aantal &#062;= BB AND Aantal &#060; BC then<BR> Response.Write "b"<BR> ElseIf Aantal &#062;= BC AND Aantal &#060; BD then<BR> Response.Write "c"<BR> ElseIf Aantal &#062;= BD AND Aantal &#060; BE then<BR> Response.Write "d"<BR> ElseIf Aantal &#062;= BE AND Aantal &#060; BF then<BR> Response.Write "e"<BR> ElseIf Aantal &#062;= BF AND Aantal &#060; 999999999999 then<BR> Response.Write "f"<BR> Else<BR> Response.Write "0"<BR> End If<BR>

  2. #2
    pani Guest

    Default RE: Multiple conditions-----> If Aantal 

    By default the scripts take integers as strings when u assign any integer to a variable<BR><BR>so try this... <BR>Aantal = 50 + 0<BR>this should work<BR>

  3. #3
    Davy Wagenmakers Guest

    Default RE: To myself

    Thank u for your solution PANI, you are right, but I found<BR>a even better solution :-) first I tried Aantal = Aantal + 0<BR>too but then I found this in the books.<BR><BR>Cint(Aantal)<BR><BR>It converts my string to an Integer.<BR><BR>Thnx!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts