Forum Replies Created

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

  • RE: Syntax advise please

    twin.devil (3/4/2014)


    its failing on the join condition .... your other table have a data type of float.

    you with ensure that data on which you are joining should be of numeric...

  • RE: Syntax advise please

    Above bolded parts in the quotes display a contradiction. Did the query run correct when removing both the CASE statements or did it NOT run correct?

    If it didn't run correct...

  • RE: Syntax advise please

    GilaMonster (3/4/2014)


    Then there's something going on that you're not telling us about, because there are no floats around in case statements I wrote for you and if the columns are...

  • RE: Syntax advise please

    GilaMonster (3/4/2014)


    Did you try mine?

    Yea but I get the same float error 🙁

  • RE: Syntax advise please

    igloo21 (3/4/2014)


    HanShi (3/4/2014)


    What is the defined datatype for column [sCustomer_number] in table [dbo].[abc_Customers] ?

    I expect the error is caused by the CASE statement. Can you confirm this by removing both...

  • RE: Syntax advise please

    ChrisM@Work (3/4/2014)


    SELECT DISTINCT TOP (100) PERCENT

    c.iCustomer_id,

    c.sCustomer_number AS CustomerNo,

    CASE WHEN c.sCustomer_number = 'SL000000' THEN 660 ELSE c.sCustomer_number END AS sCustomer_number,

    c.sCustomer_name AS CustomerName,

    c.sCustomer_state AS Customerstate,

    cc.CustomerType AS...

  • RE: Syntax advise please

    HanShi (3/4/2014)


    What is the defined datatype for column [sCustomer_number] in table [dbo].[abc_Customers] ?

    I expect the error is caused by the CASE statement. Can you confirm this by removing both the...

  • RE: Syntax advise please

    GilaMonster (3/4/2014)


    If you comment out the CASE in both the select and the where does the error go away?

    Thanks for the reply, yes it goes away, but I need this...

  • RE: A little T-SQL syntax help please

    Keith Tate (1/10/2014)


    Can you join Productss (is it really spelled with two S's :hehe:)

    Actually no it's not spelled with two s's I did some code scrubbing before posting it and...

  • RE: A little T-SQL syntax help please

    davidandrews13 (1/10/2014)


    i'm presuming that the code in your EXISTS statement always brings back at least one row?

    it looks like, because it always brings back data, the EXISTS statement will always...

  • RE: CASE WHEN date condition

    This worked wonderfully! The only thing I had to chenge was switching it from less than to greater than. A big thanks for your assistance!

  • RE: CASE WHEN date condition

    Thanks Sean. I am adding the column as "AS ImportDate". This is actually a stored proc that I am putting together that will import into an xls. The trouble that...

  • RE: CASE WHEN date condition

    delete

  • RE: CASE WHEN date condition

    So basically I'm wanting to do something like this:

    CASE WHEN ImportDays=(Select DATEADD (day,-30,getdate()))THEN 'NEW' ELSE 'Older than 30 days' END AS ImportDate

  • RE: CASE Statement not working

    quote]

    I can assure you that sql did not ignore your case expression. Did you try adding the case as a column in your select? What is returned in that column?...

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