March 31, 2011 at 10:16 am
I have the following query:
select moncalladd.opname, moncalladd.schedname, moncalladd.firstlisting,
DATEADD(MINUTE, moncalladd.AddTime, DATEADD(DAY, moncalladd.AddDate, '12/31/1899')) as added,
moncalladd.initials, dateadd(n,moncalladd.Timestamp, '12/31/1899')-(moncalladd.timestamp/1000)/60/1440 +1 as oncalldate
from mdr.dbo.moncalladd inner join mdr.dbo.moncalldelete
on moncalladd.schedname = moncalldelete.schedname and moncalladd.timestamp= moncalldelete.timestamp
WHERE dateadd(n,moncalladd.Timestamp, '12/31/1899')-(moncalladd.timestamp/1000)/60/1440+1 >= '03-21-2011' and moncalladd.schedname='CAP.NEURO'
order by oncalldate
If I run that query as is .. it runs fine but when I add the following line:
dateadd(n, moncalladd.startoncalldate, +1)+(moncall.startoncalltime/1440)+(moncalladd.Duration/1440) as addeddate,
anywhere in my query I get this error:
The column prefix 'moncall' does not match with a table name or alias name used in the query.
What am I not seeing here?
Thank you
Doug
March 31, 2011 at 12:32 pm
You're using just moncall in your middle expression, not moncalladd or moncalldelete... that table isn't in your query.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply