Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by justine1364

  1. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    I found the source of the error, it was indeed complete.documentno. Documentno is a string containing the transaction number. I was generating "orderdate" from it. As it turned out, one of those strings had 2.006 instead of 2006 in the date section of the transaction number and this is what...
  2. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    It's right aligned. Orderdate is generated from transaction number which is a string. DateValue(Format(Left(complete.DocumentNo,8),"0000\/00\/00"))) AS orderdate When I removed format, it doesn't work.
  3. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    By the way, it's always the same table...I realize I threw in 3 different names in the query example I gave previously but that's just because I unnecessarily started using a different table name in the forum than the one I actually use.
  4. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    I generated "totalsales" and sales18months columns in table1 (it's not summed by anything so it works). I'm trying to sum them up by customer in another query. SELECT linestable.customerno, sum(table.totalsales), Sum(table1.sales18months) FROM linestable GROUP BY linestable.customerno...
  5. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    I think I'm soon going to give up and just use two queries. usdsales is a numeric field but it has blank fields. I don't think it's the problem though. When I use a condition different from date, it works. Eg. sum(iif([no]='3200', usdsales, 0)) as sales Orderdate is a date and I think it has...
  6. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    I'm getting the same error with both your suggestions :)
  7. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    Sorry for "Table1" confusion. It should have been "from table1" in the second example as well. You're suggesting it doesn't work because I didn't put the else clause? I can't check now because I'm not at work, but I'll try with a 0 tomorrow. Thank you for the suggestion.
  8. justine1364

    Adding amounts based on dates - combing "sum", "iif" and dat

    I have a table with information on sales. I want to generate a table showing: - total sales per customer - sales per customer in the last 18 months The following code (which doesn't sum up anything) works: SELECT usdsales, iif(table1.orderdate>dateadd("d", -548, date()), usdsales) as...

Part and Inventory Search

Back
Top