dfwalton
Programmer
- Jul 24, 2002
- 143
I have an app where I need to apply a crew rate based on the date. Crewrate table is very simple: Region, StartDate, EndDate, Fee.
Have a stored proc that needs to get rate, based on the date of the job being done. Select code is:
select event2.EventRegion,'SAM',@newDate, event2.EventSubregion, event2.EventClient,
crewfee.crewfee,
from event as event2, crewFee
where event2.eventnum =@modelEventNum
and @newDate between crewFee.startDate and crewFee.endDate
Crewfee table has 2 rows:
Bay, 2010-04-01, 2011-03-31, 55.75
Bay, 2011-04-01, 2012-03-31, 65.75
Doing a select by itself using where clause above works fine. But in the SP, it fails to find the 65.75 rate for any date, say '05/11/11'
Any ideas?
Have a stored proc that needs to get rate, based on the date of the job being done. Select code is:
select event2.EventRegion,'SAM',@newDate, event2.EventSubregion, event2.EventClient,
crewfee.crewfee,
from event as event2, crewFee
where event2.eventnum =@modelEventNum
and @newDate between crewFee.startDate and crewFee.endDate
Crewfee table has 2 rows:
Bay, 2010-04-01, 2011-03-31, 55.75
Bay, 2011-04-01, 2012-03-31, 65.75
Doing a select by itself using where clause above works fine. But in the SP, it fails to find the 65.75 rate for any date, say '05/11/11'
Any ideas?