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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by digimortal

  1. digimortal

    Changing conditions

    I have problem like this: there are two fields in the table, type, duedate and postdate. If type (field) is X then query should looklike this: Select * from Table where duedate < 'DATE' else query should looklike this: Select * from Table where postdate < 'DATE' Can I do it in one query...
  2. digimortal

    Confused...

    Hi all, I'm writing a little bit long select query; SELECT I.ACCOUNT, C.NAME1 AS STEXT,C.COUNTRY, (CASE WHEN EXTPAYDOCNUM IS NOT NULL AND PAYMDOCKEY = '3' THEN NVL((SELECT SUM(HPOSTAMNT * (POSTWAY * 2 - 1)) AS OPENAMNT1 FROM IASFINITEM WHERE (CLIENT = '00') AND (COMPANY =...
  3. digimortal

    Time between Date range

    My Bad... :) SELECT DISTINCT CONVERT(varchar(8), DTime, 108) AS DTime2, DTime FROM EventsL WHERE (Site = 'BAK AMBALAJ') AND (Door = 'TURNiKE GiRiS') AND (DTime BETWEEN '07.01.2005' AND '07.30.2005') AND (CONVERT(varchar(8), DTime, 108) BETWEEN '18:00:00' AND '19:00:00')
  4. digimortal

    Time between Date range

    Hi All, I have table called Eventsl with four fields; DTime: 01.07.2005 18:36:00 Name: Name Surname: Surname CardNo: 1234324 and I need to get all the records between 18:00:00 and 19:00:00 between the given date parameters. Below is my query that does not work :( SELECT DISTINCT...
  5. digimortal

    Algorithm Help

    The relation is the material fields. First I get the Materials and Sold Quantities like: Material Quantity X 100 Z 500 K 1000 my color table: COLOR MATERIAL Blue X Red X Black Z Blue K Yellow K So I need: COL Material 2 X 1 Z 2 K And last stage: COL...
  6. digimortal

    Complex Count-Group Relation

    Hi all, I can not run this Query :( SELECT SUM(I.QUANTITY), (SELECT DISTINCT COUNT(COLOR) FROM COLORTABLE WHERE I.MATERIAL = MATERIAL GROUP BY MATERIAL, REVISION) as COL FROM SOLDITEMS I, COLOR C WHERE I.QUNIT = 'KG' AND I.CREATEDAT > '01.06.2005' AND I.CREATEDAT < '30.06.2005' GROUP BY COL...
  7. digimortal

    Algorithm Help

    I Hope this will explain what I'm trying to do... I know this is not SQL forum but... SELECT SUM(I.QUANTITY), (SELECT DISTINCT COUNT(COLOR) FROM COLORTABLE WHERE I.MATERIAL = MATERIAL GROUP BY MATERIAL, REVISION) as COL FROM SOLDITEMS I, COLOR C WHERE I.QUNIT = 'KG' AND I.CREATEDAT >...
  8. digimortal

    Algorithm Help

    Hi, I got Listboxs like this: First Second 1 3 1 4 1 3 2 5 3 4 3 2 4 1 5 7 5 5 What I need is to remove the duplicate items from the first one and sum all the corresponding values in the second one, so the example become: 1 10 2 5 3 6 4 1 5...
  9. digimortal

    Order By Parameter

    Problem solved.. . . . (X.LANGU = 'T') AND (X.CLIENT = C.CLIENT) AND (X.COMPANY = C.COMPANY) AND (X.ACCOUNT = C.CUSTOMER) AND (C.COUNTRY = 'TR') AND (C.ADVPACC <> '120-15') AND (C.ISDELETE =0) GROUP BY I.CLIENT, I.COMPANY, I.ACCTYPE, A.ACCIND, I.ACCOUNT, X.STEXT ORDER BY case...
  10. digimortal

    Order By Parameter

    Can not we use parameters (as fieldnames) in Reporting services? I'm putting a combobox and field names in it and let the user select the order type of the report for example: Select * from X order by @param where param is a field name. BTW I'm connecting to an Oracle DB so the format must...
  11. digimortal

    Can I do this in one Query?

    Let me do a little change: A material - 300Kg (300 Kg from IBI.QUANTITY) B material - 200Kg (200 Kg from IBI.QUANTITY) C material - 500Kg (500 Kg from IBI.QUANTITY) is being used for 1000kg (from IBH.BaseQuan) of D product and if I sell 300 Kg of D product how much the raw materials cost?
  12. digimortal

    Can I do this in one Query?

    I must send a dataset to a function and I can not do it in one Query.. the basic logic: SUM(("SELECT IBI.ComponentID, IBI.QUANTITY FROM BOMITEM IBI WHERE IBI.MATERIAL = '" & MatNum & "' " / "SELECT IBH.BASEQUAN FROM BOMHEAD IBH WHERE IBH.MATERIAL = '" & MatNum & "' " * MatQuan) *...
  13. digimortal

    Simple Select Query Problem

    Mate I don't know how to thank you but.. THANK YOU.. Now It works like a charm..
  14. digimortal

    Simple Select Query Problem

    There are there fields that holds the IDs of Department, Acc. Group and Workgroups in the Card table and I use them to get the Department, Acc. Group, WorkGroup names from other tables and if a DeparmentID or AccID or WorkgroupID is NULL then there will be a Null "NAME" field on the DBGrid.. I...
  15. digimortal

    Simple Select Query Problem

    There are five tables; CARD, AGRECS, PersonelWG, WorkGroups, C_Grp I have a DataGrid like this CARD.LNAME | CARD.MNAME | CARD.CNUM | CARD.CNAME | Deparment | Access Group | Workgroup if there are no Department, Access Group or WorkGroup then these fields will be empty and as you can see from...

Part and Inventory Search

Back
Top