Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated field in SQL Server 6.5 1

Status
Not open for further replies.

GSMike

Programmer
Feb 7, 2001
143
US
I am used to working in MS Access where you can return a value as in:
[date1]-[date2]=X

It will calculate that value provided "date1" and "date2" are fields in the recordset. One calc for each record.
I am getting an error message in SQL Server saying that neither "date1" nor "date2" are not contained in an aggregate function and there is no "group by" clause.
In Access this would not be a problem.
Can you help?
Thank you.
 
Have you checked out DATEDIFF(day, date1, date2) function in books online?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top