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 Wanet Telecoms Ltd 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: *

  1. snufse1

    Passing parm using open query

    Coming from a sequel server box and using linked server, does anyone know ho to pass a parm using open query? declare @Terminal char(1) set @Terminal = 'H' SELECT * FROM OPENQUERY(AS400SRV_MSDASQL, 'select date(digits(decimal(rcdgj + 1900000,7,0))) as transdate...
  2. snufse1

    Update with Select - getting error

    markros, You are totally right. Do not need group by "gross". I removed and now it is totaling correcly. May fault. Thank you.
  3. snufse1

    Update with Select - getting error

    Now, looks like gross is not being added up for the month update #Table1 set qty = gross select branded as product, cast(sum(gross) as decimal(15, 2)) as quantity from #Table1, tp6000.dbo.loadcomp where (branded = @Product) and...
  4. snufse1

    Update with Select - getting error

    Got it working, was missing a ")". Thank you very much. update #Table1 set qty = gross from #Table1 INNER JOIN ( select branded as Branded, cast(sum(gross) as decimal(15, 2)) as Gross from tp6000.dbo.loadcomp where branded = @ProdVar and...
  5. snufse1

    Update with Select - getting error

    Using 2005. Getting error: Incorrect syntax near the keyword 'group'.
  6. snufse1

    Update with Select - getting error

    Have following query: update #table1 set qty = gross from ( select cast(sum(gross) as decimal(15, 2)) from tp6000.dbo.loadcomp where branded = @ProdVar and (@DateFrom IS Null or date >= @DateFrom) and (@DateTo IS Null or date...
  7. snufse1

    Need to add quantities

    I think "load" is a protected word. Think I got it working: select [load], convert(char(10), Date, 101), branded, name, cast(sum(gross) as decimal(15, 2)) AS GrossTotal, cast(sum(net) as decimal(15,2)) as NetTotal from...
  8. snufse1

    Need to add quantities

    Getting Incorrect syntax near the keyword 'load'. select "load", max(convert(varchar,Date,101)) as Date, max(branded) as Branded, max(name) as Name, sum(cast(gross as decimal(15,2))) OVER (Partition by Load1.load) as GrossTotal...
  9. snufse1

    Need to add quantities

    Need to group by load (which is the bol number) select "load", date, branded, name, sum(cast(gross as decimal(15,2))) OVER (Partition by Load1."load") as GrossTotal, sum(cast(net as decimal(15,2))) OVER (Partition by Load1."load") as...
  10. snufse1

    Need to add quantities

    Need to add gross and net quantities by load number (ie load). Cannot get it to work, still shows multiple row with same load number. select "load", date, branded, name, sum(cast(gross as decimal(15,2))), sum(cast(net as...
  11. snufse1

    Print - No Web dialog box being shown

    I have an ASP application that displays a Crystal Report (pull method). When I click the print icon in CR tool bar, it looks like a new page is being opened (which I think is correct) but no web dialog box is being shown (to select printer). Can someone point me in the right direction? (Also...
  12. snufse1

    Not able to print document

    I have an ASP application where I print the Crystal Report using a print button. When I run the app on my local PC it prints fine, when I run the app from the server it does not print (but gives me message that document is printed). Aany ideas? Private Sub Print_Button_Click(ByVal sender As...
  13. snufse1

    No able to close connections

    Crystal reports make the connection as part of the pull method. It is not in the code behind. Any ideas? Thank you.
  14. snufse1

    No able to close connections

    I have an asp application that uses crystal report (pull method). From a drop down list user can select dates and each time a date is selected it runs and displays a crystal report. This works fine. The problem is that I am not able to close the connection to the data base. Every time user...
  15. snufse1

    Condition the "HAVING SUM.."

    I tried this and seems to work: HAVING (@Hours IS Null or SUM(dbo.EquipmentLaborEvent.Hours) < @Hours))m
  16. snufse1

    Condition the &quot;HAVING SUM..&quot;

    Did not work.... If hours selected by user is nothing, then query does not return any rows when it should. Should I test on Null instead of Zero? (SELECT dbo.Equipment.CompanyEquipmentID,SUM(dbo.EquipmentLaborEvent.Hours) AS hours FROM dbo.Equipment inner...
  17. snufse1

    Condition the &quot;HAVING SUM..&quot;

    Have following query below. I only need to execute the line "HAVING SUM(dbo.EquipmentLaborEvent.Hours) < @Hours)" if @Hours being passed in is not zero. How would I do that? Thank you. @Hours INT . .. ... SELECT dbo.Equipment.CompanyEquipmentID,SUM(dbo.EquipmentLaborEvent.Hours) AS hours...
  18. snufse1

    Select and syb select - need help

    Got it working. Thank you guys.
  19. snufse1

    Select and syb select - need help

    I alaso tried this: INSERT INTO #TempTable2 SELECT * FROM #TempTable1 INNER JOIN (SELECT substring(dbo.Job.CompanyJobId, 1, 10) as job, substring(dbo.Item.CompanyItemId, 1, 10) as costcode...

Part and Inventory Search

Back
Top