If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Sql please help !!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-30-04, 06:40
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
Sql please help !!

For example, This is the table name microprice in Microsoft Access.

dat price
8/23/2004 11
8/24/2004 28
8/25/2004 13
8/26/2004 24
8/27/2004 56
8/28/2004 12
8/29/2004 32
8/30/2004 21

I want to show the last five price not include the date of today. Assume today is 8/30/2004

I want to write the sql that show
8/25/2004 13
8/26/2004 24
8/27/2004 56
8/28/2004 12
8/29/2004 32

So how can I write SQl. I try to use
sql="select top 5 * from microprice where dat <> '%"&date()&"%' order by dat desc"

But it doesn't work !!!
Reply With Quote
  #2 (permalink)  
Old 08-30-04, 06:57
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
please don't cross-post

see http://www.dbforums.com/t1009057.html
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On