Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Totals query for the last date

samoteksamotek Member Posts: 9
I have a problem with building a totals query showing data
for the last date only.Under the last date i understand the last date of field invoicedate.This invoice date is in the table orders.
Therefore in the column of the query i have entered :

DMax("InvoiceDate";"Orders")

I have also tried with :

DayNumber: DatePart('d';[invoicedate])



However both my approaches have led to a query that does not show the right results.This is because i do not understand well the functions of Date part and DMax.
Can somebody help me building the query ? My aim is to show
the quantity from all those invoices that have an invoice
with an invoice date equal to the last date of the orders
entered.





Comments

  • aatkbdaatkbd Member Posts: 42
    : I have a problem with building a totals query showing data
    : for the last date only.Under the last date i understand the last date of field invoicedate.This invoice date is in the table orders.
    : Therefore in the column of the query i have entered :
    :
    : DMax("InvoiceDate";"Orders")
    :
    : I have also tried with :
    :
    : DayNumber: DatePart('d';[invoicedate])
    :
    :
    :
    : However both my approaches have led to a query that does not show the right results.This is because i do not understand well the functions of Date part and DMax.
    : Can somebody help me building the query ? My aim is to show
    : the quantity from all those invoices that have an invoice
    : with an invoice date equal to the last date of the orders
    : entered.
    :
    :
    :
    :
    :
    :

    [blue]
    I like to use sub queries instead of Domain functions. Under the criteria for the InvoiceDate field try this.

    [code]
    (Select Max([InvoiceDate]) FROM Orders)
    [/code]

    your DMax("InvoiceDate";"Orders") function should of worked. Make sure you are puting it in the criteria section of the query and not makeing it a column in the query.
    [/blue]
Sign In or Register to comment.