Search results

  1. M

    First Date Instance

    thanks for your continued work on finding a solution for me. When I place both extracts of SQL code in, I get the same error message with both.“Syntax error (missing operator) in query expression ‘s.SALEDATE’ - I think it related to the 3 line. What can I try to fix this missing operator? Thanks...
  2. M

    First Date Instance

    thanks tried this but getting a prompt each time when running query to enter CustomerID
  3. M

    First Date Instance

    Thanks will paste in SELECT [CUSTOMERS].CUSTOMERID, [SALES].[SALEDATE] FROM [CUSTOMERS] INNER JOIN [SALES] ON [CUSTOMERS].CUSTOMERID = [SALES].[CUSTOMER NUMBER];
  4. M

    First Date Instance

    thank you - the purpose of the query is to do a match on customer ID to see which customers have made a purchase so linking between sales table and customer table. Then I need to find the first sale date per customer but want it in its own column. The query will just be run and show the...
  5. M

    First Date Instance

    Thank you for your help. It’s much appreciated. I have tried this a few times and am getting #error under this field in query results. In your sample above where it says table name this is where I put the name of the sales table correct? would it be better to do this in the actual table rather...
  6. M

    First Date Instance

    I’m not sure on what the best function is to find out the following: First Sale Date per Customer I have 2 fields - Sale Date and Customer ID. I want to add a new field named First Sale Date. Do I used the Max function? Not sure how to incorporate the per Customer ID. I have made an attempt...
  7. M

    Query Criteria and Grouping 2 Date Fields

    Thank you for all your help.
  8. M

    Query Criteria and Grouping 2 Date Fields

    if the day is 0 or 1 group would be “immediate collection” and sorry “late collection” should be >=8 days but <=14 days. Then collection >=15 days would be “Other”. the reason for naming the group over 15 as other is that I’m only really interested in those between 2 and 14 days. Hope that...
  9. M

    Query Criteria and Grouping 2 Date Fields

    Thanks for the guidance. DateDiff function worked well. I am a bit stumped with the IIF function. In the field row I have put: Group: llf([DaysbetweenPrescriptionDateandAttendanceDate]>2and<=7, "sufficient collection") the error says the expression I have entered contains invalid syntax
  10. M

    Query Criteria and Grouping 2 Date Fields

    Hello, I am trying to write a query which needs to meet a condition / criteria and then if so place into different groups? for example: if a person collected a prescription >2 days and <=7 days from attending doctor surgery then place in group named “Sufficient Collection”. Or if a person...
Top Bottom