ASP Forum
date query
riley | Posted 8:38am 10. October 2007 Server Time |

I'm fairly new to ASP and need some help writing a SQL query. I am creating a SQL database with news articles, but I want to display only articles from the current year on the main page. There will be a second page displaying all articles. I need help writing the query for the current year.
Tawni | Posted 8:51pm 8. November 2007 Server Time |

SELECT  OrderDate
FROM Orders
Where Year([OrderDate])=Year(Now()) ORDER BY OrderDate DESC;
Tawni | Posted 8:52pm 8. November 2007 Server Time |

Sorry Change criteria to meet your stuff

example OrderDate is name of my Table not Yours

the Desc just makes the most recent to the top

here is my output

OrderDate
04/01/2007
03/03/2007
02/02/2007
02/02/2007
01/01/2007
01/01/2007
01/01/2007
01/01/2007
Tawni | Posted 8:54pm 8. November 2007 Server Time |

Damit

Cant edit Posts

Orders is my Table name

and OrderDate is my Field Name


Reply to Post date query



Back to Forum Page