Forum Replies Created

Viewing 15 posts - 31 through 45 (of 124 total)

  • RE: previous week query 0700 - 0700

    Hi Chris is I get the curent week number from my app then pass to sql along the way off

    Select * from dbo.DocketTB Where DatePart(Week,Docket_EngFinish ) = @weeknum

    can you...

  • RE: previous week query 0700 - 0700

    (No column name)(No column name)

    2013-07-08 07:00:00.0002013-07-15 07:00:00.000

    the rest of the data is empty

    Jay

  • RE: previous week query 0700 - 0700

    Hi Chris, just before we go any further. I am calling this query from my c# app, so the program checks the day @0700 and if its Monday that's when...

  • RE: previous week query 0700 - 0700

    Hi Chris that returns data within them dates.

    Thanks

  • RE: previous week query 0700 - 0700

    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

  • RE: previous week query 0700 - 0700

    USE [SLADB]

    GO

    /****** Object: Table [dbo].[DocketTB] Script Date: 07/18/2013 12:11:22 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[DocketTB](

    [Docket_Id] [int] IDENTITY(1,1) NOT NULL,

    [Docket_Number] [int] NULL,

    [Docket_Machine] [nchar](30) NULL,

    [Docket_Status] [nchar](10) NULL,

    [Docket_EngineerName]...

  • RE: previous week query 0700 - 0700

    SELECT *

    FROM dbo.DocketTB

    CROSS APPLY (

    SELECT MondayLastWeek = DATEADD(hh,7,CAST(CAST(DATEADD(DD,-((DATEDIFF(DD,0,GETDATE())%7)+7),GETDATE()) AS DATE) AS DATETIME))

    ) x1

    WHERE Docket_EngFinish BETWEEN x1.MondayLastWeek AND DATEADD(DD,7,x1.MondayLastWeek)

    returns no results

    SELECT *

    FROM (SELECT DTToday = GETDATE()) d

    CROSS APPLY (SELECT...

  • RE: previous week query 0700 - 0700

    hmmm still no result even tho I no there is data in there for the time period

  • RE: previous week query 0700 - 0700

    Sorry, must learn to scroll down 🙁

    J

  • RE: previous week query 0700 - 0700

    Hi Chris from the step by step I see the correct dates, but on the solution it returns no results. Is there now need for the lastweek thisweek between value...

  • RE: previous week query 0700 - 0700

    That works but am struggling to apply that to my query

    select * from dbo.DocketTB where Docket_EngFinish DATEADD( hh, 7, DATEADD( dd, DATEDIFF( dd, 0, DATEADD(dd, -7, getdate())), 0)), ...

  • RE: What data type

    GilaMonster (1/18/2013)


    jerome.morris (1/18/2013)


    s varchar(50) will always use 50 spaces or however you call them.

    Sorry I wasnt stating it does I was unsure. Thanks for your explanation

    Jay

  • RE: What data type

    varchar() or nvarchar()

    varchar(max) or varchar(x) is there no variable field, as varchar(50) will always use 50 spaces or however you call them.

    This does seem a really noob question and I...

  • RE: Running Total

    Dockets = Sum(Duration)

    looks better

  • RE: Running Total

    Hi all, this works but its not really the result I want to see. This is fact counting the number of times a category appears in the list, what I...

Viewing 15 posts - 31 through 45 (of 124 total)