Recent content by n90

  1. N

    Count Distinct excel output

    No thats not what I'm looking for, well sort of. So the query can be for instance 160 line items, 50 unique invoice numbers, and then each Invoice can have 1 or 2 line items depending on if it has taxable line item. I need to be able to export it to excel and a new worksheet every time the...
  2. N

    Count Distinct excel output

    I have a query that contains Invoices(usually 2 line items per invoice) Taxable and NonTaxable. I need to able to basically export it to excel on multiple worksheets when the Amount of unique invoice number reaches 15. From all my scouring on the internet I can't find anything with this...
  3. N

    Update date to friday

    So I have an AR report, that currently we track by our MailDate. Issue is some times the maildate is not inputted into the system and it gives the date 1/1/1900. Then I filter my report for Accounts that have that 1/1/1900 in there Maildate then I run an UPDATE query on all those Invoices to...
  4. N

    Get Last Quarter Sales

    I know how to get the Quarter from a Datetime column what I am having issue on is in the WHERE clause making a statement where if current date is Quarter 1 then get Quarter 4 from last year.
  5. N

    Get Last Quarter Sales

    So I am writing a query that gets last quarter sales and I'm trying to figure out how to make it so that WHENEVER i run it, it will get the last quarter sales. If it helps the datetime column is called DOCDATE.
  6. N

    Aging AR Report

    Hello Again! Im working on another report, an Aging AR report. And Im trying to make a column were it looks at the MailDate and then determines the Age of the AR - Case WHEN [Open AR 1].MailDate > GetDate()-30 THEN 'Current' WHEN [Open AR 1].MailDate BETWEEN GetDate()-31 AND GetDate()-61...
  7. N

    Access IIF clause to T-SQL

    So I fixed the statement - CASE WHEN Lst.LName = 'Tech' THEN [Circle K Jobs].Respond Else '.' AS Finished however it still will not run and gives me the same error.
  8. N

    Access IIF clause to T-SQL

    I'm Just trying this out - [Circle K Jobs].Job, [Circle K Jobs].RNum, [Circle K Jobs].LogDT, CASE WHEN Lst.LName = 'Tech' THEN Jjobs.Respond Else "." AS Finished, Lst.LName AS JobState, Lst_1.LName AS JobStatus It saying incorrect syntax near the keyword 'AS'
  9. N

    Access IIF clause to T-SQL

    Your a god send! Now I got another question :P, I also have a column in my query in Access that has an IIF statement now would I go about bringing that into t-sql? Finished: IIf([JobState]="Tech" And ([JobStatus]="Finished" Or [JobStatus]="Checked-in"),[jjobs].[Respond],"") Basically if the...
  10. N

    Access IIF clause to T-SQL

    Thanks that worked great however now I have an issue with the amount of jobs its pulling vs my Access DB. It seems that my Access DB when ran at lets say 8am today will pull all the Jobs from yesterday 12am till 8am today vs when I run it in SQL it will only pull Jobs from 8am yesterday to when...
  11. N

    Access IIF clause to T-SQL

    What I've been trying is this statement in the WHERE Clause - (JJobs.LogDT > (CASE WHEN GetPart(day,GetDate()) = 2 GetDate() THEN GetDate()-3 ELSE GetDate()-1))
  12. N

    Access IIF clause to T-SQL

    Just what I posted, still. Every CASE statement I tried adding to the WHERE clause does not seem to work.
  13. N

    Access IIF clause to T-SQL

    Can you elaborate a little more on this, I'm still having alot of difficulty with migrating it over.
  14. N

    Access IIF clause to T-SQL

    Hey all so I need to convert this daily report I run every morning to T-SQL, however I am having extreme difficulty converting the IIF statement I have in the Where clause of my access report to SQL. Here is what I currently have and works fine - SELECT JJobs.Job, JJobs.RNum...
  15. N

    Daily Query report

    I'm not exactly sure how to add this to my Query, cause I just currently have 2 were one is set to filter via Date()-1 and the other Date()-3.
Back
Top Bottom