Forum Replies Created

Viewing 15 posts - 2,161 through 2,175 (of 2,452 total)

  • RE: simple one table query

    Performace Guard (Shehap) (10/15/2011)


    You could proceed it using the below query :

    create table #temptable (F1 int, [F2.1] varchar (20), [F2.2] varchar (20), [F2.3] varchar (20))

    insert into #temptable (F1 )

    select...

  • RE: simple one table query

    I am going to assume this is "homework"...this question or variations of it, appear on SSC regularly.

    so...food for thought...hope this gives you some ideas.

    -- create some data

    with produce (id,fruit, varieties)

    as...

  • RE: Convert Stored Procedure to Access Queries

    Ninja's_RGR'us (10/13/2011)


    Now if you're talking about ADP then I absoletely agree that this makes a powerful mix of front end / back end.

    plus 1

    also DSNless MDE's to preconfigured SQL...

  • RE: Help with Pivot

    I think this may help in providing you with a tried and tested solution....the code below is based on the data you initially provided.

    I have had to rip/strip and create...

  • RE: first day of month 12 months ago

    does the following help...courtesy of Lynn Pettis

    https://www.sqlservercentral.com/blogs/lynnpettis/archive/2009/03/25/some-common-date-routines.aspx

    declare @ThisDate datetime;

    set @ThisDate = getdate();

    select dateadd(dd, datediff(dd, 0, @ThisDate), 0) -- Beginning of this day

    select dateadd(dd, datediff(dd, 0,...

  • RE: Aging Payments query help

    Tom Bakerman (10/10/2011)


    You've all been a great help. Keep up the good work. Thanks.

    Tom

    Tom..what code have you got so far...can you post please...maybe it will help.

  • RE: Aging Payments query help

    Tom Bakerman (10/10/2011)


    BUT, one clarification, and this is where I seem to get stuck:

    The result for the current month is MTD (GETDATE()). The count for previous months is for...

  • RE: Aging Payments query help

    J Livingston SQL (10/9/2011)


    different approach....may be give you some ideas

    pls note ...date range vailidity needs scrutiny

    comments in code

    USE [tempdb] --- a safe place

    GO

    --== condtionally drop table...

  • RE: Aging Payments query help

    different approach....may be give you some ideas

    pls note ...date range vailidity needs scrutiny

    comments in code

    USE [tempdb] --- a safe place

    GO

    --== condtionally drop table for retesting in...

  • RE: PIVOT FOR DYNAMIC ROWS

    subasuga (10/8/2011)


    Hi..

    I have a table whose number of rows is determined only at run time. The dataset is divided into group of 5 (represented by sampleNo)

    Like this...

    1......AAAA......Sample1

    2......SSSS.......Sample1

    3......HHHH.......Sample1

    4......UUUU.......Sample1

    5......IIIIIII.......Sample1

    6......BBBB.......Sample2

    .........

    10.....XXXX......Sample2

    11......CCCC.......Sample3

    ............

    15.......DDDD.......Sample3

    .......

    n........TTTT........SampleN

    I dont know how...

  • RE: HierarchyID performance problems... Really???

    Jeff Moden (10/4/2011)


    Heh... I figured that out from your post where you said you never used it before. 🙂 I was hoping some of the other denizens of SSC...

  • RE: Date Conversion

    SELECT COL1,COL2... convert(varchar,YOUR_DATE_COLUMN, 3)

  • RE: HierarchyID performance problems... Really???

    Jeff Moden (10/3/2011)


    Maybe I should change the question a bit... are any of you using the HierarchyID data type?

    No.

    maybe useful in the future when dealing with 3rd pty dbs.

  • RE: Group by on join

    Sean Lange (9/29/2011)


    ghanshyam.kundu (9/29/2011)


    can you post your DDL properly with constraint of two tables. as per me your table design is not correct.

    you should have deptid in emp table as...

  • RE: Replacement for union

    hopefully this will give you some ideas.

    pls post back if not undestood.

    ---=== use tempdb...nice safe place

    USE [tempdb]

    GO

    ---=== drop tables if they already exist....makes it easier for reruns in SSMS

    IF ...

Viewing 15 posts - 2,161 through 2,175 (of 2,452 total)