Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Here I am Unable to reload QV when writing SQL case statement, where as if I load without that case statement, it runs successfully. But if we put that case statement and load it says connection OLE DB error and there after that case. I am sure I have connected thru the correct data source but unable to run. Need help.
SELECT OU_TourCode,
case when charindex('D',substring(OU_TourCode,1,4)) > 0 then '' else OU_TourCode end as [OU_TourCode],
case when charindex('8',substring(OU_TourCode,5,8)) > 0 then '' else OU_TourCode end as [OU_TourCode],
case when charindex('8',substring(OU_TourCode,5,len(OU_TourCode))) > 0 then '' else OU_TourCode end as [OU_TourCode]
FROM dbo.*********_history with (nolock)
where 1=1
condition......*******
Please help.
Kindest Regards
Shubham Kumar
Hi, Shubham
Your query returns the fields with the same name (OU_TourCode) a few times.
This is fine on SQL, but QV will not accept it, because the field name is very important to the associative logic.
If you need the query like this, you need to at least rename the fields.
Hope this helps,
Erich
Thank you Shiino,
This solution provided by you have worked
Thanks & Regards
Shubham Kumar