Forum Replies Created

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

  • Reply To: get year/month min/max from dates

    What format are the dates in? datetime (12/29/2019 00:00:00)

    How would you know which columns to interrogate? I don't, I'm thinking any column that contains a "/" in it as a...

  • Reply To: Scientific number in varchar column

    Jeff, that would be the best case scenario, but we get many clients that give to us as is and don't want to do more.  It is in excel and...

  • Reply To: Scientific number in varchar column

    looks like I have some data too large to convert to numeric because I am getting this error:

    Invoice = coalesce(cast(cast(try_cast([Vendor invoice] As float) As numeric(38,0)) As varchar(50)), [Vendor invoice]),

    error:

    Arithmetic overflow...

  • Reply To: Scientific number in varchar column

    Frederico,

    The issue is, it doesn't work.

    I get this error:

    Arithmetic overflow error converting float to data type numeric.

    When I try this line below:

    Case When [Vendor invoice] Like '%E+%' Then Cast(Convert(numeric(24,0), Cast([Vendor...

    • This reply was modified 4 years, 10 months ago by  GrassHopper.
  • Reply To: Scientific number in varchar column

    Phil, those are excluded from conversion...I'm just showing what is in the data.  The only ones that would be converted would be the numbers with E+ in it.  This also...

    • This reply was modified 4 years, 10 months ago by  GrassHopper.
  • Reply To: Scientific number in varchar column

    The original column is a varchar type. I want to convert the scientific number to a number without scientific notation (i.e. 38784939843) and I want the value to remain in...

    • This reply was modified 4 years, 10 months ago by  GrassHopper.
  • Reply To: Dynamic Insert Command

    SQLian and Thom, Thank you! both.  I wish i could set both to the answer but it only lets me set 1 of them.  I've learned something from both of...

  • Reply To: Dynamic Insert Command

    Thom,

    Thanks for getting me 99% therre, but I'm not getting the list of the field names, just 1 field name appears in the list on the insert and select side. ...

    • This reply was modified 4 years, 12 months ago by  GrassHopper.
    • This reply was modified 4 years, 12 months ago by  GrassHopper.
    • This reply was modified 4 years, 12 months ago by  GrassHopper.
    • This reply was modified 4 years, 12 months ago by  GrassHopper.
  • Reply To: Dynamic Insert Command

    GrassHopper wrote:

    SQLian,

    How do I add the field names to your code?  I tried Thom's but Not all my tables have identity fields...in fact they are only 6 out of 30...

  • Reply To: Dynamic Insert Command

    SQLian,

    The msg I get when I run your code is this:

    Table 'UNFI_WEST_F_Compressed.dbo.UNFI_LI_SHORT' does not have the identity property. Cannot perform SET operation.

    It is picking out a table without an identity...

    • This reply was modified 4 years, 12 months ago by  GrassHopper.
  • Reply To: Dynamic Insert Command

    SQLian,

    How do I add the field names to your code?  I tried Thom's but Not all my tables have identity fields...in fact they are only 6 out of 30 in...

  • Reply To: Turn If statement into Case

    Jeff Moden wrote:

    I have to ask... what are you pasting the code from?

    Jeff, I copied it from SQL studio to notepad and then here.  I'm not sure why it put...

  • Reply To: Turn If statement into Case

    John, thanks for the clarification in the definition of words.  I'm a little loose with my terminology sometimes.

  • Reply To: Turn If statement into Case

    That Worked! Thanks Des.

  • Reply To: Openrowset error

    My question is...Why am I getting this error msg when i run some excel files???  They don't look different and column 17 and 18 in excel are empty...in the ones...

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