Forum Replies Created

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

  • RE: How to select from 5 lines but only display 3

    whenriksen - Thursday, January 12, 2017 12:12 PM

    Post some DDL and sample data.  Your question looks fairly involved and I don't want to...

  • RE: Remove almost Duplicate Records

    So I hope I'm not making this too complicated but here is exactly what I would need. As you can see, AUTOID 63646 and 63647 are ok because even though...

  • RE: Sum inside of Select Statement

    So it worked somewhat. I just have to find the error for 0 if encountered as that is the error I am getting:

    Divide by zero error encountered.

    Warning: Null value is...

  • RE: Need a little help

    Maybe this would be better. Here is the table

    select b.cust_code, a.part_no,

    COUNT(CASE WHEN b.date_entered >= DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) - 6, 0)

    AND b.date_entered < ...

  • RE: Need a little help

    Msg 156, Level 15, State 1, Line 9

    Incorrect syntax near the keyword 'IF'.

    Msg 195, Level 15, State 10, Line 9

    'AVERAGE' is not a recognized built-in function name.

  • RE: Need a little help

    Not getting an error. I am trying to get the if equation to work correctly so that if the average of the sum of the 3 fields is less then...

  • RE: Need a little help

    Ok, so I tried to then do an average but getting an error. Would you happen to know what is missing

    select a.[Sales Rep], a.CustomerName as [Customer Name], a.AcctNumber, a.StartDateI as...

  • RE: Need a little help

    Thank you very much for your help.

    I will have to look into that. I only do it to reference the tables using because many of the tables used have...

  • RE: Open Excel File

    Not really. I have VBA programing built inside of the excel file and I just want to be able to open the excel file so that upon opening the VBA...

  • RE: Move file help

    I figured it out incase anyone wants to do the same:

    declare @FileName varchar(1000), @FilePath varchar(1000), @FullPath varchar(1000), @destPath varchar(1000), @destFileName varchar(1000),

    @destFullPath varchar(1000), @move varchar(1000)

    SET @FilePath = '\\164.43.10.23\global$\Price_List_Files\run_sql\'

    SET @FileName = Left(CONVERT(VARCHAR(10),GETDATE(),120),10)...

  • RE: Parsing Data

    Worked like a charm. Thank you very much.

  • RE: A Little Help

    It is not. Is the password I made up to my test db that I am testing on.

  • RE: Import of Excel or Txt File into Database

    Server does have access to that path and I have looked at that as well and I tried a lot of the mentioned solutions but still nothing. I am hoping...

  • RE: Import of Excel or Txt File into Database

    Nothing else is open. I am not sure if it may be a compatibility issue because we are using 32-bit office but 64-bit SQL

  • RE: Import of Excel or Txt File into Database

    I also tried this code:

    SELECT * INTO [ThomasSci].[dbo].[DONNAWESNERINP]

    FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',

    'Excel 12.0 Xml;HDR=YES;Database=\\111.17.10.23\global$\Stocking_Request\_macro\WESNERINPUT.xlsx',

    'SELECT * FROM [Sheet1$]');

    and got this error message:

    Msg 7308, Level 16, State...

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