digimortal
Programmer
I wrote a simple query (not a storedproc) with an order by but it does not work
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
ORDER BY @Ord
I tried things like
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
CASE WHEN @Ord is null THEN CHName END
and this:
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
Order By IsNull(@Ord,CHName)
but none of them worked..
Thnx in advance...
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
ORDER BY @Ord
I tried things like
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
CASE WHEN @Ord is null THEN CHName END
and this:
SELECT *
FROM EventsL
WHERE (Door = 'yemekhane') AND (Site LIKE @Site) AND (CONVERT(CHAR(10), DTime, 110) = @Tar)
Order By IsNull(@Ord,CHName)
but none of them worked..
Thnx in advance...