I am a novice and need some help. What I want to accomplish is this...
If I have 3 people coming into my shop on the same day and all three need a rental car, but I only have one rental car so I need to tell if the car booking is overlapped.
I was trying something like this, not sure if this is the best way to go.
declare @FromDate as datetime = '05-01-2012',
@ToDate as datetime = '05-31-2012'
select (select COUNT(c1.[FixDate]) from core c1) as 'NbrofCars',
c.[Program Date] as 'Prog Date',
convert(varchar, c.[Program Time], 108) as 'FixTime'
FROM Event e
INNER JOIN core c ON c.EventId = e.EventId
where convert(varchar, c.StartDateTime, 101) between @FromDate and @ToDate
If I have 3 people coming into my shop on the same day and all three need a rental car, but I only have one rental car so I need to tell if the car booking is overlapped.
I was trying something like this, not sure if this is the best way to go.
declare @FromDate as datetime = '05-01-2012',
@ToDate as datetime = '05-31-2012'
select (select COUNT(c1.[FixDate]) from core c1) as 'NbrofCars',
c.[Program Date] as 'Prog Date',
convert(varchar, c.[Program Time], 108) as 'FixTime'
FROM Event e
INNER JOIN core c ON c.EventId = e.EventId
where convert(varchar, c.StartDateTime, 101) between @FromDate and @ToDate