Viewing 15 posts - 691 through 705 (of 26,487 total)
Sort of like this:
create table [dbo].[mytable]
(
[StartDate] date not null primary key
, [CalendarMonth] as datepart(month,[StartDate]) persisted
, [CalendarYear] ...
November 6, 2018 at 12:32 pm
Also, you really shouldn't be using a loop for this. You could put this into the table from your other thread.
November 6, 2018 at 12:27 pm
November 6, 2018 at 12:10 pm
It probably needs some additional work but I will leave that to you to at least attempt first. Questions or problems please come back here.
November 6, 2018 at 12:07 pm
Here is a partial solution. It doesn't incorporate the WHERE clause for the time sheet information.
/****************************************************************************************
Generate employee data
****************************************************************************************/
if object_id('[dbo].[Employee]','U') is not null
...
November 6, 2018 at 12:04 pm
Use the table in your other thread here, https://www.sqlservercentral.com/Forums/2008707/get-qtrmonth-and-year-from-start-date?Update=1#bm2008841, using the [fy_year] and [fy_month] columns to create the YYYY-MM, like this:
CAST([fy_month] as varchar(4)) + '-' + right('0' + cast([fy_month] as...
November 6, 2018 at 10:47 am
Just one thing missing, to get the expected results how is the query run. I am trying to figure out how the employees come together using the start and end...
November 6, 2018 at 10:05 am
November 6, 2018 at 9:49 am
November 6, 2018 at 9:48 am
Using Lynn's code and replacing the code for the sample date with your actual table...
November 6, 2018 at 9:46 am
Not sure why microsoft make the checkbox...
November 6, 2018 at 9:42 am
Okay, here you go.
create table [dbo].[mytable]
(
[StartDate] date not null primary key
, [CalendarMonth] as datepart(month,[StartDate]) persisted
, [CalendarYear] as datepart(year,[StartDate])...
November 6, 2018 at 9:29 am
Viewing 15 posts - 691 through 705 (of 26,487 total)