Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: dba112233
  • Content: Threads
  • Order by date
  1. dba112233

    Cannot reference file in BULK INSERT statement

    for some reason, SQL cannot open the file below. I checked the path and in the run prompt it opens fine. It's a synax error I think but the error doesn't say, it's just a generic error: BULK INSERT tablename FROM 'c:\Documents and Settings\sss\Desktop\myfile.txt'
  2. dba112233

    Run SQL Job for certain timezone?

    How can I tell the scheduler to run at certain times for specific time zones in SQL Server 2000? I don't see a time zone option, just daily, weekly, etc. then times
  3. dba112233

    Question on value

    In my query below, is HAVING cb.CurrentBalance <> SUM(rf10.rmstranamt10) - SUM(rf.rmstranamt) the same as the value that my CASE statements come up with for [balance] ? Isn't putting straight SUM(rf10.rmstranamt10) - SUM(rf.rmstranamt) overriding what I want to be there which is: HAVING...
  4. dba112233

    Help - Value not correct

    If I have incoming values of rmstranamt rmstrancde 50.00 51 50.00 51 50.00 51 50.00 51 50.00 51 50.00 51 50.00 51 -50.00...
  5. dba112233

    SUM not working

    Here's the SUM portion of my code: INNER JOIN ( SELECT RMSFILENUM, RMSTRANCDE, SUM( CASE WHEN rmstrancde IN ('50','51','52','53') AND rmstrancde < 0 THEN rmstranamt WHEN rmstrancde IN ('50','51','52','53') AND rmstrancde >= 0...
  6. dba112233

    'ABS' is not a recognized function name.

    SUM( CASE WHEN rmstrancde IN ('50','51','52','53') THEN (0 - ABS(DISTINCT rmstranamt)) WHEN rmstrancde IN ('55','56','57','58') THEN ABS(DISTINCT rmstranamt) ELSE DISTINCT rmstranamt END ) As rmstranamt ERROR...
  7. dba112233

    Need help with creating a new TEMP table

    What I want to do is because I cannot perform cursor transactions inside an INNER JOIN, I need to take the following portion out below and throw that filter into a temp table first at the very top of my entire stored procedure. Then I need to reverence that temp table instead of teh RFINAL...
  8. dba112233

    Errors with DECLARE statement

    I am trying to do a cursor and such in one of my INNER JOINS which is part of a bigger SQL statement. I am getting the following errors: Msg 156, Level 15, State 1, Procedure Balance_Query, Line 61 Incorrect syntax near the keyword 'DECLARE'. Msg 137, Level 15, State 1, Procedure...
  9. dba112233

    Returning more than one of same acct instead of sum for both

    Code not combining acct number results. The code below returns for example: 74981995170968 1595.00 253.54 1341.46 940.40 74981995170968 1595.00 2281.86 3876.86 940.40 It should be: 74981995170968 1595.00 2535.4 1341.36 940.40...
  10. dba112233

    How to encorporate IF

    How can I put an If statement saying If # RECORDS returned from the query below IF # records returned is > 1 then SUM(rmstranamt) AS rmstranamt10 ELSE rmstranamt AS rmstranamt10 SELECT RMSFILENUM, rmstranamt AS rmstranamt10 <-----If statement goes here base on if...
  11. dba112233

    Query showing Double of same value

    In this query, I get results 4313030999894992 85.00 3265.12 3180.12 3528.43 4313030999894992 178.31 3265.12 3086.81 3528.43 There should not be 2 values of 3265.12. Somewhere it's duplicating this and I don't know how. If I run this query below: SELECT rf.rmstrancde...
  12. dba112233

    SUM Question

    Let's say you have the following Acct# Amount 1122 300 1122 300 1122 500 How do I write a SUM on Amount and tell it not to add both 300, just one of them with the 500? So basically I'm treating any amounts with the same value as one unique amount then adding it to...
  13. dba112233

    No Longer Grouping on certain fields !!!

    For some reason, Sum rmstranamt is not being grouped and added together at the end, same for Sum rmstranamt 10: SELECT rm.rmsacctnum, SUM(rf.rmstranamt) AS [Sum rmstranamt], SUM(rf10.rmstranamt10) AS [Sum rmstranamt 10], CASE WHEN SUM(rf.rmstranamt) >...
  14. dba112233

    SUM Problem

    The problem with my SUM below is that I don't want it to sum up like amounts. For example, there may be multiple rmstranamt showing but if in the list there are 2 that are alike, just sum up one of them along with the others. In other words, I need to somehow do a grouping of the rmstranamt so...
  15. dba112233

    Nested Case Statements

    I can't get the syntax right on my nested CASE statements nor have I found anything on the web pertaining to nested SQL CASE statements: SELECT rm.rmsacctnum AS [Rms Acct Num], SUM(rf.rmstranamt) AS [TranSum], SUM(rf10.rmstranamt10) AS [10Sum], CASE WHEN...
  16. dba112233

    How to check for postive or negative then perform operation

    I need to check SUM(rf.rmstranamt) for positive or negative Rules should be: If SUM(rf.rmstranamt) is negative SUM(rf10.rmstranamt10) + SUM(rf.rmstranamt) AS [Balance] If SUM(rf.rmstranamt) is positive SUM(rf10.rmstranamt10) - SUM(rf.rmstranamt) AS [Balance] instead of how I am just...

Part and Inventory Search

Back
Top