SQLTeam.com | Weblogs | Forums

Working this query


#1

Hello

I don't know why this query doesn't work for. can you help me please?
thank you

select (200/[traveltimeLkw])*3.6 as v_lkw, [entrytime] ,[vLkwCommon]
FROM [VRZ1010].[vdp_archiv_stv].[dbo].[STV_SVL_Archiv_20175] A
inner join [dbo].[DayCategory] B ON weekdayname='Mo' AND CONVERT(date,A.[entrytime])=B.[day]
where [roadcode]='A23_1' and [from2dk]>=9000 and [to2dk]<=10000


#2

Without Table DDL and sample data, we would just be guessing. What do you mean it doesn't work. Do you get an error? Do you get no result or an undesired result?


#3

I can reformat it so that it's at least legible...

SELECT
    v_lkw = (200 / traveltimeLkw) * 3.6, 
	entrytime, 
	vLkwCommon
FROM
    VRZ1010.vdp_archiv_stv.dbo.STV_SVL_Archiv_20175 A
    JOIN dbo.DayCategory B
        ON ONVERT(DATE, A.entrytime) = B.day
WHERE
	weekdayname = 'Mo'
    AND roadcode = 'A23_1'
    AND from2dk >= 9000
    AND to2dk <= 10000;

As far as what may be wrong... No idea, We don't know if you getting errors of an answer you don't agree with.