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 Chris Miller 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. iluvwitter

    Convert text to string

    I have the following sql and trying to convert the hard code fields (tran_type and flag) to integer. These are currently resulting as text fields. Can someone advise how? Tried to put a cast around it, but it keeps giving me a syntax error. select '0' as 'tran_type', '1' as 'flag', tradedate...
  2. iluvwitter

    Pull where date is within next 7 days

    Trying to write a query to pull all products expiring in the next 7 days. I have an expiredate column and the date is in format (yyyy-dd-mm + timestamp). Need to pull any dates = today or within 7 days. Timestamp is always 00:00:00.00. Please help!
  3. iluvwitter

    Insert rows into Table A leveraging specifc values existing in Table B

    I am using a variable set by the user to insert multiple rows into a table leveraging values from another table. Insert into TableA (code, type) values (@code, type) The type value is from another table, but I want to insert a row in TAble A for each Type existing in Table B. So if 5...
  4. iluvwitter

    consolidate two fields in two different records to one record in JOIN

    Hi, I am trying to set up a massive query with many joins and case statements. I'm noticing that my results are duplicating and can see why, but not sure the best way to fix it. To simplify it, let's say I have two tables. Table A is orders and Table B is sub-orders. Table A doesn't have...
  5. iluvwitter

    IF Exists within Case statements

    Hi, I am trying to use multiple case statements based on the manager code selected. Depending on the manager code, I need to check the holdings and trade tables. If the symbol exists in either the holdings or trades table, default that strategy, else default "NEW_STRAT". Im not sure what the...
  6. iluvwitter

    sp_send_dbmail

    disregard I figured it out.
  7. iluvwitter

    sp_send_dbmail

    Hi, I am trying to send an email with query results in the text message. The query I am running is rather large but it seems to be having a problem with the values. I am able to run the proc with a simple select * from table statement but when I insert a value I get an incorrect syntax error...
  8. iluvwitter

    Return multiple values via multiple select/case and add to variables

    The issue is, I can't modify the table. It is an existing table so I need to store values in code to get the result I need????
  9. iluvwitter

    Return multiple values via multiple select/case and add to variables

    Hi, I am trying to return multiple values using select/case statements and include those values in a text message and send via sql mail. The table will display which jobs have ran via codes. I want to gather all the codes that ran today and substitute the codes with a different value...
  10. iluvwitter

    Return data for present day using case?

    Thanks all. Can you also help me figure out how to return multiple values but using a case statement substitute those values with another value. i.e. if codes A and C were run today, i want to be able to substitute Apple for A and Cat for C and output: The following reports were output today...
  11. iluvwitter

    Return data for present day using case?

    Hi, I'm really new to SQL. I am trying to set up a query that runs automatically daily to pull any data populated in a table for the present day (not just for today but ongoing daily). I do not want to have to have to update the date in the query daily. The table only populates with codes of...
  12. iluvwitter

    breaking down a date field into two fields in different format

    i am a fairly new access user and need to break down a date field set up like this: 06/27/02 INTO 2 fields: 'fiscal year' and 'fiscal month' How do i query the data to read the '06' in the date field and return it into the fiscal month field as '09'? and how do make it read the '02' and return...

Part and Inventory Search

Back
Top