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 > ANSI SQL > Question about Max function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-04, 09:12
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
Question about Max function

I have table name datagraph
dat price
08/30/2004 23
09/1/2004 100
09/1/2004 21
09/1/2004 12
09/1/2004 32

I want to write Sql that show the highest price of today. I tried

sql="select max(price)from datagraph where dat like '%"&date()&"%')"

It does not work !!
Reply With Quote
  #2 (permalink)  
Old 09-01-04, 12:25
gannet gannet is offline
Registered User
 
Join Date: Oct 2002
Location: Plymouth UK
Posts: 116
Which database server?
Reply With Quote
  #3 (permalink)  
Old 09-01-04, 13:17
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
To echo gannet, which database engine? It would also help if you could post the DDL for the table, since it looks like your dat column might be text of some kind instead of a date column.

-PatP
Reply With Quote
  #4 (permalink)  
Old 09-01-04, 13:28
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
it's access, and it's a text column

see http://www.dbforums.com/t1009057.html

gop373, use a DATE/TIME column
__________________
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On