Multiple select in 1 query
-
Hi...can any1 assist me plz....im using sql 2005...i have multiple selects seperated by if statements like this:
IF @Monday = 0
SELECT [Day],[Date] FROM dbo.fnGetDatesforAday('2008/09/10', '2008/09/30','Monday')IF @Tuesday = 1
SELECT [Day],[Date] FROM dbo.fnGetDatesforAday('2008/09/10', '2008/09/30','Tuesday')is there a way to execute both selects as 1 query
living life on the flip side
-
Hi...can any1 assist me plz....im using sql 2005...i have multiple selects seperated by if statements like this:
IF @Monday = 0
SELECT [Day],[Date] FROM dbo.fnGetDatesforAday('2008/09/10', '2008/09/30','Monday')IF @Tuesday = 1
SELECT [Day],[Date] FROM dbo.fnGetDatesforAday('2008/09/10', '2008/09/30','Tuesday')is there a way to execute both selects as 1 query
living life on the flip side
SELECT
[Day],[Date]
FROM
dbo.fnGetDatesforAday('2008/09/10', '2008/09/30',(
SELECT
CASE @Monday
WHEN 0 THEN 'Monday'
WHEN 1 THEN 'Tuesday'
ELSE 'Other'
END)
)It's a wild guess, I haven't executed it though.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions