Every now and then the Query statement below will produce the error
"The multi-part identifier "ev.loc_n" could not be bound." Can anyone explain why and how I can prevent or correct query below?
Thanks.
[SQL]: select ev.loc_n "Location",
sum(case when ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-04-02 03:59:00.000' then ev.key7 else 0 end) "Apr 1",
sum(case when ev.ts >= '2014-04-02 04:00:00.000' and ev.ts <= '2014-04-03 03:59:00.000' then ev.key7 else 0 end) "Apr 2",
sum(case when ev.ts >= '2014-04-28 04:00:00.000' and ev.ts <= '2014-04-29 03:59:00.000' then ev.key7 else 0 end) "Apr 28",
sum(case when ev.ts >= '2014-04-29 04:00:00.000' and ev.ts <= '2014-04-30 03:59:00.000' then ev.key7 else 0 end) "Apr 29",
sum(case when ev.ts >= '2014-04-30 04:00:00.000' and ev.ts <= '2014-05-01 03:59:00.000' then ev.key7 else 0 end) "Apr 30"
[Error]: SQLSTATE = 42S22
Microsoft SQL Server Native Client 10.0
The multi-part identifier "ev.loc_n" could not be bound.
select ev.loc_n "Location", sum(case when ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-04-02 03:59:00.000' then ev.key7
[SQL]: from ev, ml
where ml.loc_n=ev.loc_n and ml.id=ev.id
and ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-05-01 03:59:00.000'
and run>100 and route<9000 and ev.fs in (1,2,3,4,5,6,7,8,9)
group by ev.loc_n
order by ev.loc_n
[Error]: You must login as a Genfare administrator to execute this statement
"The multi-part identifier "ev.loc_n" could not be bound." Can anyone explain why and how I can prevent or correct query below?
Thanks.
[SQL]: select ev.loc_n "Location",
sum(case when ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-04-02 03:59:00.000' then ev.key7 else 0 end) "Apr 1",
sum(case when ev.ts >= '2014-04-02 04:00:00.000' and ev.ts <= '2014-04-03 03:59:00.000' then ev.key7 else 0 end) "Apr 2",
sum(case when ev.ts >= '2014-04-28 04:00:00.000' and ev.ts <= '2014-04-29 03:59:00.000' then ev.key7 else 0 end) "Apr 28",
sum(case when ev.ts >= '2014-04-29 04:00:00.000' and ev.ts <= '2014-04-30 03:59:00.000' then ev.key7 else 0 end) "Apr 29",
sum(case when ev.ts >= '2014-04-30 04:00:00.000' and ev.ts <= '2014-05-01 03:59:00.000' then ev.key7 else 0 end) "Apr 30"
[Error]: SQLSTATE = 42S22
Microsoft SQL Server Native Client 10.0
The multi-part identifier "ev.loc_n" could not be bound.
select ev.loc_n "Location", sum(case when ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-04-02 03:59:00.000' then ev.key7
[SQL]: from ev, ml
where ml.loc_n=ev.loc_n and ml.id=ev.id
and ev.ts >= '2014-04-01 04:00:00.000' and ev.ts <= '2014-05-01 03:59:00.000'
and run>100 and route<9000 and ev.fs in (1,2,3,4,5,6,7,8,9)
group by ev.loc_n
order by ev.loc_n
[Error]: You must login as a Genfare administrator to execute this statement