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 Mike Lewis 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. devon59

    Counting number of times the customer has been contacted: Count restart with 1 after each order

    Hi,I would appreciate your help. Here's what I am trying to do. I have a dataset that tells me customerID, contact date, order date. I want to find out how many times on average customers have been contacted before they place order. Right now, I have my code as data contact1; set contact...
  2. devon59

    Import fixed format data into SAS dataset - with error

    Hi, I am encounter the problem while trying to read this fixed format data into SAS dataset. The raw data is large about 85 million records total and the layout I was given was Field Length ID 8 date 9 amount 12 Source 14 The code I am...
  3. devon59

    Import raw data from fixed format .txt file - SAS 9.0

    Hi, I am having a problem importing the data from a fixed format text file. The total width of the records is 2309 characters. The owner of the text file said the data is one row per record ID. However, when I open the data to look in Notepad, it seems that the data is 3 rows per ID. I am...
  4. devon59

    SQL language that act the same as "&" in Excel or || in SAS

    Thank you Denny and PH. Would what you recommendd work in SQL 2005?
  5. devon59

    SQL language that act the same as "&" in Excel or || in SAS

    Hi there, I am trying to create a new variable base on a combination of the characters in an existing value. For example, Var1 has a value "ABCDEFG" and I would like to create a Var2 which should look like "ABC__F". I tried substring(ltrim(rtrim(Var1,1,3))) to get "ABC" part. However, I don't...
  6. devon59

    Random select 5000 records

    Thank you thank you thank you! It worked!
  7. devon59

    Random select 5000 records

    Hi, I got another error. I basically did not do select all variables(*) in the second query of the union so the error message said "ORDER BY items must appear in the select list if the statement contains a UNION operator." Basically, this is what I have. SELECT A, B, C FROM mail left...
  8. devon59

    Random select 5000 records

    Thank you. However, one more question regarding this. When I UNION this query to another one, I got an error message saying "Error Near Order". Could you please help? Thank you. (SELECT * FROM mail left outer join Orders on mail.ID=OrdersID WHERE and Orders IS NOT NULL ) UNION...
  9. devon59

    Random select 5000 records

    Hi there, What is the syntax to do random select 5000 records? Could any one please help. Thank you very much.
  10. devon59

    Select only Null records from query

    Thank you so much!!! That worked!
  11. devon59

    Select only Null records from query

    hmm... it still doesn return anything. Maybe my query is wrong. Let me explain into more detail. Basically, I have 2 files, one has all records that I mailed to and another has only people that responded. I want to join the 2 table but select only people that did not respond. How do I do...
  12. devon59

    Select only Null records from query

    Hi there, I was trying to select Not NULL record from below query but it did not return anything. Could anyone please help? Basically, I want to get only records the people that did not order. Thank you so much. SELECT result1.* FROM (SELECT tbl1.Mail, tbl2.Order FROM tbl1 left outer...
  13. devon59

    Create Record Layout

    Hi there, Is there any easy way that I could get all columns data type for my output instead of me having to go through each variable and look at them one by one? I'm looking for something similar to Proc contents in SAS. Thank you
  14. devon59

    Case-When to convert VarChar to Numeric variable

    I'm trying to create a new variable base on existing variable, BuyerID, using case-when statement. However, the query I have doesn't work. Could anyone please help? Part of the query and error message are below. ************************* case when BuyerID='Null' then 1 else 0 end as...
  15. devon59

    How to GROUP BY var created from Case-when statement

    Thank you so much pwise. That worked.
  16. devon59

    How to GROUP BY var created from Case-when statement

    Can anyone help? I would like to group the records by the variable I created from case when statement but I got an error saying that that new variable is not part of the table. For example, this is what I have. Select A, B, C, case when A=1 then 'Y' else 'N' end as Flag from Client_table...
  17. devon59

    SQL syntax that equals to Trim in excel

    Thank you George. Please bare with me but I don't want to replace a space but just get rid of it. Isn't Replace used when I want to replace something?
  18. devon59

    SQL syntax that equals to Trim in excel

    Could anyone tell me what is the sql syntax that gives me a similar result as Trim in excel? Basically, I have the data that has space in the middle and I want to get rid of that space. e.g. 111 111 111 and I want to get rid of spaces between the ones. Thank you

Part and Inventory Search

Back
Top