how we can count records as a group of days like sum of
records for(four mondays),(four tuesday)........ in a month.
group the column for weekdays.
Answer / harshad lakkad (bapunagar) par
--First Create This Function To Return a week Days For
Particular Date--
CREATE FUNCTION [dbo].[udf_DayOfWeek]
(@dtDate DATETIME)
RETURNS VARCHAR(10)
AS
BEGIN
DECLARE @rtDayofWeek VARCHAR(10)
SELECT @rtDayofWeek = CASE DATEPART(weekday,@dtDate)
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 7 THEN 'Saturday'
END
RETURN (@rtDayofWeek)
END
--Now Use this Function As Below
SELECT
Sum(Bank.Amount),
dbo.udf_DayOfWeek(Bank.Date) AS DayOfWeek
From Bank
Group By Bank.Date
-- Here Bank.Amount And Bank.Date Are Column Name Of Bank
Table
Is This Answer Correct ? | 1 Yes | 0 No |
You are doing log shipping due to some reasons it is failing. How you will proceed from there
Tell me can we use custom code in ssrs?
What are different types of views?
What is built-in/administrator?
What is 2nf normalization form?
What is checkpoint process in the sql server?
What are different types of constraints?
What is a cursor, index in sql?
What are the different editions available in sql server 2000?
What is data source in connection string?
Explain basic SQL queries with SELECT from where Order By, Group By-Having?
Does full backup break log chain?