Search results

  1. M

    how to combine 2 separate queries in sql server

    Can someone please help . I have 2 SELECT queries A and Query B , the 2 queries were 1 before I separated them due to running slow taking 18minutes . I have now split the 2 queries and A runs in 25 secs , B runs instantly . Both produce same number of records Question What will be...
  2. M

    String or binary data data would be truncated error message

    Hi I am executing an INSERT INTO Column1 Column2 SELECT FROM Column1 Column2 Statement with about 50 columns and getting the String or binary data would be truncated error .SQL doesnt tell you which column is the issue does anyone know the fastest way to find out the culprit...
  3. M

    translate IIFs in a where clause to CASE statements

    hi Could someone please help. this is an access query with IIF's statements , as you can see I have translated to CASE WHEN but am having trouble translating the WHERE part of this clause .Thanks SELECT Capability_Q.IDQ, Capability_Q.Capability, Capability_Q.OtherDesc...
  4. M

    SSIS packages

    am trying to design SSIS for ETL from access/excel sheets to SQL Server and will require transformation with script task in VB. the SQL Database in question is on a Shared server and cant get SA permission on the virtual box. the suggestion from the 3rd line support team is to create and...
  5. M

    how Can I use VBA Code in SSIS

    Hi I am trying too build SSIS package for ETL with an access database after migration . A Collection tool was written that gets the data from excel and transforms / formats , then loads into access. Ive put here the part of the VBA code used in the tool . Task at hand: I need to be able to...
  6. M

    Warning:Null value is eliminated by an aggregate or other set operation

    Hi- I am getting the desired number of records when I run my query but getting the all common warning message Warning:Null value is eliminated by an aggregate or other set operation Could someone please advise what can be done to this warning message that appears is this something that can...
  7. M

    Operand data type bit Error using Aggregate function on BIT data type Column

    Can someone please help 1.getting the following error when running the following Query Error: Operand datatype bit is invalid for min operator . I have googled and suggestion were to use CASE WHEN or CAST as tinyint. just wondering which is better and why as both seem to work but not sure...
  8. M

    tsql to JOIN the results of 2 temp tables

    Hello Please need help with Part 2 . how to join data from temp table am trying to create a simple stored . 1. that dumps the results of 2 view into 2 different temp table . this works fine SELECT * INTO #temptable FROM vwdata1 SELECT * INTO #Temptable2 FROM vwdata2 2. Run my...
  9. M

    View running very slow

    Hello I have a view A which has been split into 2 separate views B and C View C takes 2 secs to run View B takes 6 secs to run Main View A is taking 32 mins to run.ive run a Display Estimated Execution Plan. nothing been suggested like indexes or anything . also mot of the Cost is 0%...
  10. M

    Nested IIf to CASE STATEMENT

    hello Can someone please help to translate this IIF statement to CASE WHEN. tried doing this myself but not working --IIf(Sum(IIf([QTR_ID]=[QtrID],1,0))>0,"Yes","No") AS [Change This Qtr Y/N] CASE ( SUM(CASE WHEN [QTR_ID]=[QtrID] THEN 1 ELSE 0)) WHEN >0 THEN YES ELSE NO...
  11. M

    Divide by Zero error encountered

    I have converted the following access IIF statements to SQL Server TSQL and getting DIVIDE by Zero error . Can anyone help please Access ------([EndDateFor]-(IIf([EndDateLastBase] Is Null,[EndDateBase], [EndDateLastBase])))/(IIf([EndDateLastBase] Is...
  12. M

    SQL Server Invalid Column name error while referencing alias in CASE Statement

    Hello I am trying to create a view and getting Invalid column name error when executing this Select statement CREATE VIEW [dbo].[test] AS SELECT ProjectReturn_Detail.DepartmentID, ProjectReturn_Detail.QTRID, ProjectReturn_Detail.ProjectID, ProjectReturn_Detail.ProjReturnID, Min(CASE...
  13. M

    translate Nested IIF statement with minus to CASE WHEN SQL Server

    Can someone please help. need help with translating this IIF's statement to SQL Server CASE Statement . I dont what am meant to do to the minus part of the statement I understand the part that reads CASE WHEN latestbaselineDate is NULL Then OriginalBaselineDate ELSE LatesbaselineDate END...
Top Bottom