emblewembl
Programmer
Hi,
I've got a stored procedure which returns a list of race data ordered by date and time where the race date is >= to today, i.e. all races that have not yet happened. The conditoinal bit of the stored procedure looks like this:
It returns what I expected BUT what I actually want is time accurate data, so i only want the races where the race time is > than the time now. So I sort of want this:
but it doesn't quite work because it only returns races where the racetime is >= the time now regardless of the race date.
What I actually want is for it to return all races where the meetingdate >= todays date
AND if todays date = meetingdate THEN where racetime >= @theTime
.....but I don't know how to write this!!! Can anyone help??
i love chocolate
I've got a stored procedure which returns a list of race data ordered by date and time where the race date is >= to today, i.e. all races that have not yet happened. The conditoinal bit of the stored procedure looks like this:
Code:
where tid.raceid = r.raceid
and m.meetingDate >= @today
It returns what I expected BUT what I actually want is time accurate data, so i only want the races where the race time is > than the time now. So I sort of want this:
Code:
where tid.raceid = r.raceid
and m.meetingDate >= @today
and racetime >= @theTime
but it doesn't quite work because it only returns races where the racetime is >= the time now regardless of the race date.
What I actually want is for it to return all races where the meetingdate >= todays date
AND if todays date = meetingdate THEN where racetime >= @theTime
.....but I don't know how to write this!!! Can anyone help??
i love chocolate