Recent content by pke8jt

  1. P

    syntax for select case conditional statement

    Well I tried if Month(qry.Parameters("BeginDate")) + 1 = 2 Then c = 1 if Month(qry.Parameters("BeginDate")) + 1 = 3 Then c = 1 if Month(qry.Parameters("BeginDate")) + 1 = 4 Then c = 1 if Month(qry.Parameters("BeginDate")) + 1 = 5 Then c = 2 if Month(qry.Parameters("BeginDate")) + 1 =...
  2. P

    syntax for select case conditional statement

    well I did and I still have red line on Select qry.Parameters("QuarterBeginDate").Value Thank you for your time to looking into this
  3. P

    syntax for select case conditional statement

    I see what you mean! will run and let you know
  4. P

    syntax for select case conditional statement

    Hi Collin, could you explain what do you mean by date delimiter?
  5. P

    syntax for select case conditional statement

    Problem : I get red colored on Select qry.Parameters("QuarterBeginDate").Value Question: what kind of statement should I use for correct syntax? Code: qry.Parameters("QuarterBeginDate").Value = [Forms]![Run]![QuarterBeginOrderDate] qry.Parameters("QuarterEndDate").Value =...
  6. P

    top 3 customer but one of them is sum of multiple parameter

    Hi Arnelgp, I'm terribly so sorry for keep bothering you. I found out when I run two queries separately, the 2nd part of query is giving me the output that I desire (corret_2.jgp), But when I run it together with Union, then the order is somehow mixed up (wrong.jpg). Would you please take a...
  7. P

    top 3 customer but one of them is sum of multiple parameter

    Neither of them works for me.. But I really appreciate all your time!! Thank you so much!
  8. P

    top 3 customer but one of them is sum of multiple parameter

    Thank you for the reply, arnelgp! When I run the code, I get 'The ORDER BY expression (Sum(SalesHistory.DollarsSold)) includes fields that are not selected by the query. Only those fields requested in the first query can be included in an ORDER BY expression.' SQL: SELECT...
  9. P

    top 3 customer but one of them is sum of multiple parameter

    Thank you for your reponses! Do you mind If I ask a follow-up question??? arnelgp code works except that I would like to ORDER BY Sum(SalesHistory.DollarsSold) DESC; Instead of ORDER BY 1 DESC; (It gives me the first 3 alphabetical parameters) SQL: SELECT Sum(SalesHistory.DollarsSold)...
  10. P

    top 3 customer but one of them is sum of multiple parameter

    Hi arnelgp, thank you so much for your reply. I have syntax error in union query message. Would you please give me any advice on this? Thank you so much again! SQL: SELECT Sum(DollarsSold) AS SumDollarsSold, "B_TOTAL" As CustomerNo FROM dbo_SO_SalesHistory WHERE...
  11. P

    top 3 customer but one of them is sum of multiple parameter

    Hi, Collin Thank you for your response. I have tried inner join, format method, IIF statement but they don't seem like the solution that is applicable to my case. So are you suggesting create a query of sum of f X (4), Y (3), Z (2) AND B (5), name it as B_Total And a TOP 3 query or SQL with...
  12. P

    top 3 customer but one of them is sum of multiple parameter

    Question When generating a top 3 customer result, Is it possible to include a sum value in it? my current query: Sum of Dollar | Customer 10 | A 8 | B 5 | C desired query output 14 | B_Total 10 | A 5 | C B_Total (14) is the sum of X (4), Y (3), Z (2) AND B (5) And [History.CustomerNo]...
  13. P

    sudden compile error in query expression, IIF

    I'm using Access 2007 - 2010. I guess I will just keep running the query from VBA. Sorry for the dumb question..
  14. P

    sudden compile error in query expression, IIF

    Hi, George. Yeah I tried running the query through VBA and Macro, and It worked. I think when I run the query from SQL view or design view, It gives me the compile error.
  15. P

    sudden compile error in query expression, IIF

    My alternate code is PARAMETERS [BeginDate] DateTime, [EndDate] DateTime; SELECT FORMAT(Sum(dbo_SO_SalesHistory.DollarsSold)),0 AS SumOfDollarsSold FROM dbo_SO_SalesHistory WHERE (((dbo_SO_SalesHistory.InvoiceDate) Between [BeginDate] And [EndDate]) AND...
Back
Top Bottom