SQL question

Results 1 to 2 of 2

Thread: SQL question

  1. #1
    Join Date
    Dec 1969

    Default SQL question

    I am wondering, I have a table that has 2 different price fields in it for each product. If the price fields match then there is NO sale going on. If the price fields dont match, then that means a sale is going on. I need to pull out a random 5 products that HAVE a sale going on and put them into a recordset. Any help would be much appreciated....<BR><BR>Here is what I was thinking:<BR><BR>&#060;%<BR>prod_disc = some discount????<BR><BR>the names of the price columns are price1 and sale1<BR><BR>strQuery="SELECT * product WHERE round(sale1,2) &#060;&#062; round("& prod_disc &" * price1,2) ORDER BY name"<BR><BR>SET objRS = objConn.Execute(strQuery)<BR><BR>&#039;This will find all the products that dont&#039; have equal price values (the products which are ON sale)<BR><BR>Now I have to take this recordset and pull 5 RANDOM records from it.....Any help would be much appreciated.....<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL question

    Do either of these help?<BR><BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=65<BR><BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=173

Posting Permissions

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