General information
Forum:
Microsoft SQL Server
Title:
MIN - DateTime issue
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only