SQL Query - Floor

Results 1 to 2 of 2

Thread: SQL Query - Floor

  1. #1
    Join Date
    Dec 1969

    Default SQL Query - Floor

    I have a problem where I have to find out the Number available in the Database with the value immediate high and immediate low to the value supplied <BR><BR>for example <BR><BR>Table t1<BR>number<BR>-------<BR>819<BR>849<BR>949<BR>1024<BR><BR><BR>If I put the value 909 then I need the value 849 and 949 <BR>the immediate higher and immediate lower to the value supplied <BR><BR>Can any one help me on how to do that. <BR>Thanks <BR><BR>Piyush<BR><BR><BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Query - Floor

    [code language="T-SQL"]<BR><BR>"Select Top 1 [Number] From t1 where [Number] &#062; " & numberentered & "<BR><BR>Select top 1 [Number] From t1 where [Number] &#060; " & numberentered & " Order By Number DESC"<BR><BR>[/code]

Posting Permissions

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