Forum Replies Created

Viewing 15 posts - 1,396 through 1,410 (of 1,957 total)

  • RE: Complex Case Expression

    tdpearce (5/19/2011)


    Thanks so much for helping me out on this.

    I'm getting a ORA-00905: missing keyword error at CROSS APPLY

    Ok, that is an ORACLE error message - you have posted...

  • RE: Complex Case Expression

    Yes, that helps...

    Try this (I have added some comments where I changed the code):

    SELECT A.REPORT_DATE, A.REPORT_TYPE, A.ORD_NUM, A.CKT_QTY, A.SUPP_VER, A.ORD_TYPE, A.ORDERPRO_TIN, A.BILLABLE, A.VENDOR, A.E_MRV_FLAG, A.MRV, A.ORDER_EXPEDITE, A.ORDER_EXPEDITE_TYPE, A.PROJECT, A.NASPID, A.CONV_NASPID,...

  • RE: Complex Case Expression

    Listen, I gotta get some chow now, so I will post this and hope you can take it from there:

    SELECT RESULTa, BUCKETa

    FROM <your first table>

    <some kind of JOIN> <your second...

  • RE: Complex Case Expression

    tdpearce (5/19/2011)


    I guess I'm confused what I would put in the "your table" then..

    SELECT RESULTa, BUCKETa

    FROM <your table>(???)

    You might want to post each query in full in order to progress...

  • RE: Complex Case Expression

    That makes no difference to the code I posted, except you are not selecting just from one table....

  • RE: Order varchar numericly

    PHXHoward (5/19/2011)


    Some SQL Server versions have three decimal places like 8.00.2055 and some have four decimal places 10.50.1600.1.

    Is padding the beginning or end of the short version numbers the best...

  • RE: Complex Case Expression

    This is one of those times when CROSS APPLY makes your life much easier....

    SELECT RESULTa, BUCKETa

    FROM <your table>

    CROSS APPLY (

    SELECT CASE WHEN DATEa=DATEb THEN 0

    WHEN DATEa> DATEb THEN NETWORKDAYS(DATEb, DATEa)

    WHEN...

  • RE: Find patterns in a field

    That is quite a difficult one to answer because we don't know what you consider to be a pattern.

    It looks like you are using "d" to indicate a numeric digit,...

  • RE: Order varchar numericly

    Sure, there is a really simple way to handle this and other "numeric stored as char" sorting issues....

    ORDER BY LEN(<column>),<column>

    The LEN(<column>) sort puts smaller numbers (fewer digits) at the start...

    Of...

  • RE: Combinations and Permutations

    You can certainly simplify the code, but probably not the plan....

    SELECT a.id 'a', b.id 'b', c.id 'c', d.id 'd', e.id 'e'

    FROM Combinations a

    CROSS JOIN dbo.Combinations b

    ...

  • RE: GROUPING by WEEK when weeks span multiple months

    Ninja's_RGR'us (5/18/2011)


    Here... you'll have to get the right holidays for your country(ies) but the rest of it is done.

    I'll have one of those, thanks a lot Ninj 😉

  • RE: GROUPING by WEEK when weeks span multiple months

    Adam Bean (5/18/2011)


    Thanks mister. A route I had debated; however not really looking to take that avenue at this time. I'm still working on being able to do within my...

  • RE: GROUPING by WEEK when weeks span multiple months

    You need to just use the week start date for each date in your data.

    I would recommend using a "dates" table, containing the year, month, date and week number, then...

  • RE: Linked Server Inner Join Query

    steve.anderson 7639 (5/18/2011)


    Hi:

    The query below:

    SELECT [dbo].[Purchasing].PartNumber, [LinkedServer].[SharePointProgress].[dbo].[tblPart].[PartDesc], [dbo].[Purchasing].IsHardware

    FROM [dbo].[Purchasing] --as table

    INNER JOIN [LinkedServer].[SharePointProgress].[dbo].[tblPart] as linkedtable

    ON [dbo].[Purchasing].PartNumber = [LinkedServer].[SharePointProgress].[dbo].[tblPart].[PartNum]

    produces this:

    Msg 4104, Level 16,...

Viewing 15 posts - 1,396 through 1,410 (of 1,957 total)