Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MIN - DateTime issue
Message
From
25/04/2005 15:11:06
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
MIN - DateTime issue
Miscellaneous
Thread ID:
01008193
Message ID:
01008193
Views:
57
Hi,

TABLEA
-------
CustomerID -unique identifier
Name - varchar
DateRegistered - datetime
#ofDaysOff - int
#FreeDaysOff - int

My problem is that I need to get to get the employeeid of most senior employee with a criteria of 2 days off.

I have tried this query but I dont get the correct date

DECLARE @customerid as varchar(100)
SELECT @customerid = customerid, MIN(DateRegistered) FROM
TABLEA WHERE #ofDaysOff = 2
GROUP BY customerid


Thanks for your help.

A
Next
Reply
Map
View

Click here to load this message in the networking platform