Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Clock-In/ Clock-Out

    dwain.c (2/11/2013)


    No idea because I don't know what Day 01, Day 02, etc. are supposed to represent.

    ;WITH Punches AS (

    SELECT *

    ...

  • RE: Clock-In/ Clock-Out

    Day 01 represents sunday and Day 02 - monday and so on.

  • RE: Clock-In/ Clock-Out

    dwain.c (2/11/2013)


    MAX(day_value)-DATEDIFF(minute,MIN(punchTime), MAX(punchTime))/60.

    dwain, Thanks again.

    how can i compare the day_name between @table and shiftpatterns table to get day_value from shiftpattern table.

    I added an extra line in the...

  • RE: Clock-In/ Clock-Out

    dwain.c (2/11/2013)


    p.ramchander (2/11/2013)


    I agree with you vinu. Dwain's logic is very nice and simple. Thanks Dwain for your time and help. I replaced the logic with your's.

    Now, I created a...

  • RE: Clock-In/ Clock-Out

    I agree with you vinu. Dwain's logic is very nice and simple. Thanks Dwain for your time and help. I replaced the logic with your's.

    Now, I created a table named...

  • RE: Clock-In/ Clock-Out

    vinu512 (1/22/2013)


    I think this is what you are looking for :

    Declare @table Table(ClockID Int, EmployeeID int, punchTime DateTime, punchType Bit)

    Insert into @table

    Select 8,769,'2013-01-22 14:26:35.590',1

    Union ALL

    Select 9,769,'2013-01-22...

  • RE: Database backup error

    Thanks for the pointer scott. It worked for me.

  • RE: SQL Server Query to group sequential dates

    Thanks Cadavre. your solution also worked.

  • RE: SQL Server Query to group sequential dates

    Thanks a ton mike your solution worked for me.

  • RE: SQL Server Query to group sequential dates

    Not necessarily grouping by months, there are chances that the interval starts end of month and ends in first week on next month

  • RE: SQL Server Query to group sequential dates

    yes, the difference between the start date and end date is fixed to 1 day difference.

  • RE: Datdiff of hh,mm.mi

    DECLARE @STARTDATE DateTime

    SET @STARTDATE = '2011/11/11 15:25:26.680'

    DECLARE @ENDDATE DateTime

    SET @ENDDATE = '2011/11/11 15:25:48.957'

    SELECT(DATEDIFF(d,@STARTDATE, @ENDDATE)) as DaysDiff,

    (DATEDIFF(ww,@STARTDATE, @ENDDATE)) as WeeksDiff,

    (DATEDIFF(hh,@STARTDATE, @ENDDATE)) as HoursDiff,

    (DATEDIFF(MINUTE,@STARTDATE, @ENDDATE)) as MinDiff,

    (DATEDIFF(SS,@STARTDATE, @ENDDATE)) AS SecDiff,

    CAST(DATEDIFF(HH,@STARTDATE,@ENDDATE) AS...

  • RE: Column length

    Nice Question.

    Thanks

  • RE: COUNT_BIG

    Thanks for the question. Learn something new today.

  • RE: syncing Active Directory with sql server 2005

    Hi Sree

    Try this code

    selectconvert(varchar(50), [Name]) as FullName,

    convert(varchar(50), Title) as Title,

    convert(varchar(50), TelephoneNumber) as PhoneNumber,

    convert(varchar(50), mail) as Email,

    convert(varchar(50), department) as Department

    INTO [Table Name]

    fromopenquery(ADSI,'selectName, Title, TelephoneNumber, mail, department

    FROM ''LDAP://OU=Users,OU=,DC=,DC=,DC=,DC=''

    WHERE objectCategory...

Viewing 15 posts - 1 through 15 (of 16 total)