|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Most Recents Dates
Hey everybody...
Please help! I'm at a sticking point. Sorry I can't provide a URL as this is on an intranet. What I'm trying to accomplish: Getting the most recent announcements from a newsletter organized by date. There are several announcements to one date. As people submit announcements.. How do you write the SQL properly to show only the latest group of announcements. I cannot hard code a date or filter by date as the dates change. Just need the group of MOST RECENT announcements. Table title: Announcements Fields are: 1. date_id <<< the date column 2. Title <<< the title of the record 3. Body <<< the main text body 4. id <<< Autonumber Right now I have been to figure out is to sort by date and have ALL showing SELECT * FROM Announcement ORDER BY date_id DESC |
|
#2
|
|||
|
|||
|
RE: Most Recents Dates
Well, it depends on what database system you are using..if it is MySQL, use the LIMIT functionality:
SELECT * FROM Announcement ORDER BY date_id DESC LIMIT 10 That would limit the results to 10. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Most Recents Dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|