Search results

  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...
  16. P

    sudden compile error in query expression, IIF

    I'm not using any vba for this query. I just use SQL view to type and run my SQL code. Is there anyway that I can print out 0 instead of null value on my query, not using VBA?
  17. P

    sudden compile error in query expression, IIF

    I'm using Access 2007- 2010. And I make the query out of table, dbo_SO_SalesHistory which was ODBCed from database. Can I provide you any other information that you may need?
  18. P

    sudden compile error in query expression, IIF

    I really appreciate that you are keep trying to help me out. I have image attached for your regard, about the error message. Please don't hesitate to tell me what I did wrong! Thank you!
  19. P

    sudden compile error in query expression, IIF

    Thank you for the reply. I'm getting syntax error at Nz. Sorry that I have mentioned earlier, I'm using MS-Access
  20. P

    sudden compile error in query expression, IIF

    Hi, I used an actual aggregation function in my IIF statement, so that my query at execution time know what the column SumOfDollarsSold is. Then I get compile error in query expression, 'IIF(ISNULL(Sum(dbo_SO_SalesHistory.DollarsSold)),0,Sum(dbo_SO_SalesHistory.DollarsSold)'. It is bizzare...
Back
Top Bottom