• 0

Help with MSSQL Server 2000


Question

Hi there,

I started programming queries with MSSQL Server 2000, and I have a question for you guys.

I need a query that returns the next activity (in date from now) from a list of activities in a SQL database.

******************

Example :

SELECT TOP 1 Date, Activity

FROM dbo.Activities

WHERE ???????

ORDER BY Date

******************

How the hell am I supposed to write it ? I would really appreciate if you guys could send me the correct syntax.

THANKS A LOT !

Link to comment
https://www.neowin.net/forum/topic/12264-help-with-mssql-server-2000/
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I tried what you said, but it doesn't seem to work... am I missing something here ?

The only thing I need in fact is a way to return today's date : I tried the "Today ()" or "GetDate ()" variables, but my system refuses to valid my syntax. After that, I tried this :

SELECT TOP 1 Date, Titre

FROM dbo.Activit?s

WHERE dateDiff("dd",Date,getdate())<=0

The syntax is OK, but when I try to save the query I get an ADO error for misusing the GetDate() function ???

I'M STUCK. Could someone help me ?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.