|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Date selection problem
Can someone please help me out
What I would like to do is select the most recent date for a field that has multiple entries. TBL = EMSAL Select * FROM EMSAL WHERE ???? Example: Number Date Increase Percent 10000 01/01/2003 2500 10% 10000 10/10/2003 500 2% 10000 31/12/2003 1000 6% The "Number" is common , the "Increase" is ramdom as well as the "Percent". As per the example there are 3 entries for Number 10000, I only want the most recent date to come through in my query results. Required result is : Number Date Increase Percent 10000 31/12/2003 1000 6% Your help is greatly appreciated. Regards Big Kev |
|
#2
|
||||
|
||||
|
You need to use a proper DATE fieldtype for the database you're using. This will allow you to
Code:
SELECT * FROM EMSAL ORDER BY `date` DESC LIMIT 1 |
|
#3
|
|||
|
|||
|
Quote:
Thanks for that The table is set to datetime is the query supposed to look like this? SELECT *FROM EMSAL ORDER BY 'SMN_DATEC ' LIMIT 1 Thanks |
|
#4
|
|||
|
|||
|
One more thing i forgot to mention is that the date can differ between different numbers. So I can not just use one date to look for
|
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Date selection problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|