Search results

  1. L

    Error 3125

    Hello! I'm using Access 2007. I had a query that worked fine a few days ago. I had to change a few things this morning and I now get Error 3125 "Reports - Campaign " is not a valid name. I've tried changing the name and it still has the same issue regardless of what the query is called...
  2. L

    Trouble getting query to select records based on datediff

    Thanks vbaInet. I tried what you suggested last night and it ground the query to a complete halt. So I've amended it this morning so that the sub query makes a table and the this query runs from the table. When I run this though it still brings up 2 campaigns as shown below: Campaign name...
  3. L

    Trouble getting query to select records based on datediff

    Apologies, I'm not explaining myself very well. The results are not totally duplicates, the differ in a few ways: ampaign name Potential Customer actualstart product_estrevenue...
  4. L

    Trouble getting query to select records based on datediff

    Ok, I use a subquery to get results like: Campaign name Potential Customer actualstart product_estrevenue Created On Date Difference StoreSafe Campaign...
  5. L

    Trouble getting query to select records based on datediff

    I'm trying to measure ROI of marketing campaigns. I've gained access to our Dynamics CRM system via odbc as the reporting feature in Dynamics CRM is balls. Essentially there are 4 tables: Campaigns Leads Opportunities Opportunity Products In a nutshell when a lead has shown interest in a...
  6. L

    Count values within overlapping date criteria

    I've filtered the records now I want to filter counts based on the contact expiry date, so we can monitor the success of the campaign monthly as well as administrative and logistical reasons, like this: Month 1 - Feb: Count all contracts after 01/02/10 and expire before 30/04/10 Month 2 -...
  7. L

    Count values within overlapping date criteria

    When a contract is due for expiry we aim to contact our customers within 3 months prior to try to renew the contract. We have quarterly campaigns to do this but the marketing comes out of one budget. So for the month of feb we get all exipry dates up until the end of april and for march we get...
  8. L

    Count values within overlapping date criteria

    Hello, I have a crosstab query that selects and counts all contracts that are due within 3 months of Febuary, March and April. I'm trying to pull counts together and I'm using Select Case for the criteria as below: Public Function Months(DiscDate As Date) As String Select Case DiscDate...
  9. L

    Prioritse a queries return value

    That's an excellent solution! Thanks
  10. L

    Prioritse a queries return value

    Hello, I'm not sure how easy or if indeed it is possible but I have a query that is pulling through values for contacts. I have two tables Accounts and Contacts, for some reason or another the values in contacts have duplicates of the same contact but a seperate job titles. See below...
  11. L

    Iif statment in module

    It's sorted, it was down to null values, I ran an update query to set nulls to 0 and it works now. Thank you both for your help!
  12. L

    Iif statment in module

    DCrake, I think it might be something to do with null values, is there any way round that? As for the SIC descriptions, they don't all match what we need them to fall into so I'm breaking it down my end.
  13. L

    Iif statment in module

    here's the full SQL too in case that's of any use.... TRANSFORM Count([Enhanced Companies Data Send Table].SICCode) AS CountOfSICCode SELECT [AccountsAll Accounts].[Cust Serv Region] FROM [Enhanced Companies Data Send Table] INNER JOIN [AccountsAll Accounts] ON [Enhanced Companies Data Send...
  14. L

    Iif statment in module

    I've imported the excel file as a table and the SIC Code field is being imported as a Long Integer. I've changed the syntax to Public Function SIC(SICCode As Long) As String Select Case SICCode Case Is < 15000: SIC = "Manufacturing" Case Is < 22000: SIC = "Manufacturing"...
  15. L

    Iif statment in module

    It returns ?SIC(16000) Manufacturing However when I type ?SIC(44000) it returns 'runtime error 6' Overflow Thanks
  16. L

    Iif statment in module

    Thanks for the quick responses. That's just the start of what I'm doing hence the gaps in SIC's and the somewhat shorter code. I might also add that this is working from a linked excel file and I'm not sure whether that makes a difference or not. I'm still getting the same type of error...
  17. L

    Iif statment in module

    Hello, I'm writing my first module ever and I'm a bit stuck. I'm having to put this in a module because the IIF I was using within a query was too long, I assume a module is my only choice? Anyway here's the code I have so far but it returns "Data Type Mismatch in Criteria Expression"...
  18. L

    Excluding records from a query

    Thanks That worked great
  19. L

    Crosstab Query Help, I think...

    Hello there, I'm not even sure a cross tab query covers this. What I'm trying to do is create a query that will count how many companies I have in a particular catagory. I have decided those catgories by SIC codes and I have numerous columns along these lines that count how many within each...
  20. L

    Date BETWEEN

    Try >= [Date] and enter the date when the box appears. That's how I do it and it works for me.
Back
Top Bottom