Forum Replies Created

Viewing 15 posts - 541 through 555 (of 3,544 total)

  • RE: SQL join statement to include NULL values

    You have to LEFT JOIN both tables, i.e.

    SELECTp.YearMonth AS PastYearMonth, OH.SHIPTO AS Location, LEFT(OH.ORDDATE, 6) AS YearMonth

    FROMPast12Months AS p

    LEFT JOIN OEORDH AS OH ON LEFT(OH.ORDDATE, 6) = p.YearMonth

    AND...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to tune this query

    Grant Fritchey (3/9/2015)


    Grace09 (3/8/2015)


    Can anyone help me tune this query? Name column is nonclustered index with include column, ID and ParentID

    SELECT DISTINCT .[ID], .[ParentID]

    FROM [Items]

    WHERE LOWER(.[Name]) = 'Test'

    execution...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL join statement to include NULL values

    Example

    SELECT h.SHIPTO,LEFT(h.ORDDATE,6) AS [YearMonth],p.YearMonth AS [PastYearMonth]

    FROM Past12Months p

    LEFT JOIN OEORDH h ON LEFT(h.ORDDATE,6) = p.YearMonth

    NOTE: The use of LEFT to match ORDDATE is not efficient as it...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL join statement to include NULL values

    If Past12Months contains ALL 12 months then you need to start with Past12Months and left join OEORDH and OEORDD

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Adding weekday name to x-axis in a chart

    faulknerwilliam2 (3/2/2015)


    Thanks. Basically the report serves as a snapshot of the previous week so is sound for that purpose.

    However, when you say ' otherwise data will be aggregated ' -...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: VB.Net - Changing a Label's Text Property

    Sorry forgot you are using ToolStrip, to close the menu use the HideDropDown method on the owning ToolStripMenuItem of RandomIntToolStripMenuItem

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Adding weekday name to x-axis in a chart

    Glad you found a solution however if you are grouping by day name make sure your date range does not span more than a week otherwise data will be aggregated...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: 2008 R2 Adding a columm with time differences between transactions per employee/date

    but it didn't work

    My query (with changed column names) against the new sample produced the results shown.

    run for almost 1 hours

    This solution will not scale well as the joining the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: VB.Net - Changing a Label's Text Property

    RandomInt is set up as a combo box (dropdownlist)

    You should use SelectedIndexChanged event to monitor when the user selects a value from a combo box and in your case...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Adding weekday name to x-axis in a chart

    Try this instead

    =String.Format("{0:dddd}",Fields!Date.Value)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: 2008 R2 Adding a columm with time differences between transactions per employee/date

    ;WITH cte (BrNum,Emp_Num,Trn_Dt,_Time,Trn_Dt_Time,RowNum)

    AS (

    SELECTBrNum,Emp_Num,Trn_Dt,_Time,

    CAST(CONVERT(char(10),Trn_Dt,120)+' '+STUFF(_Time,3,0,':') as datetime),

    ROW_NUMBER() OVER (PARTITION BY BrNum,Emp_Num,Trn_Dt ORDER BY _Time ASC)

    FROM Store_

    )

    SELECT a.BrNum,a.Emp_Num,a.Trn_Dt,a._Time,

    ISNULL(CAST(STUFF(CONVERT(char(5),DATEADD(minute,DATEDIFF(minute,b.Trn_Dt_Time,a.Trn_Dt_Time),0),114),3,1,'') as int),0)

    FROM cte a

    LEFT JOIN cte b ON b.BrNum = a.BrNum AND b.Emp_Num...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: T sql

    Already answered in dupe post

    http://www.sqlservercentral.com/Forums/Topic1664045-391-1.aspx

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: VB.Net - Changing a Label's Text Property

    Personally I use the appSettings section of the app.config and have a standard form I use to add to projects to show and edit the settings and restart the app...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Wild Card search

    What second dataset?

    Do you not have one parameter and one dataset (to retrieve all data for all databases) and currently filtering the dataset with the parameter?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Wild Card search

    Add a filter to the dataset

    Set the expression to

    =Left(Fields!DatabaseName.Value,Len(Parameters!ReportParameter1.Value))=Parameters!ReportParameter1.Value

    Change the expression return to Boolean

    Leave operator as =

    Set Value to true

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 541 through 555 (of 3,544 total)