Jumat, 30 Desember 2011

[MS_AccessPros] Re: Need help with query for form

 

The expression that Crystal suggests will always show yesterday's CashLeft. If you want this to be one day earlier than the SalesDate of the current record, you can try:

=DLookup("[CashLeft]","[Tablename]","[SalesDate]=#" & [SalesDate] - 1 & "#")

Duane Hookom
MS Access MVP

--- In MS_Access_Professionals@yahoogroups.com, Crystal <strive4peace2008@...> wrote:
>
> Hi Kathleen,
>
> Welcome!
>
> make a textbox with this ControlSource:
>
> =DLookup("[CashLeft]","[Tablename]","[SalesDate]=#" & Date()-1 & "#")
>
> WHERE
> CashLeft is the field with cash left at the end of the day
>
> Tablename is the name of the table
>
> SalesDate is the field with your date of sale
>
>
> Warm Regards,
> Crystal
>
>  *
>    (: have an awesome day :)
>  *
>
>
> ________________________________
> From: KTT47
>
> How hard it is to learn.  How easy it is to forget!
>
> The system I inherited is mostly stable right now, so I have not done any coding in a while.  Now I want to make a change and I cannot for the life of me figure out how to approach it.
>
> I have a summary form that is filled out for each day.  One of the fields is the cash left at the end of the day.  Actually, that is a calculated field but the record contains the data to calculate it.  What I want to do is show the previous days cash on today's form.  The key is the date. So when the date, for example, is December 2, I want to see the cash that was left in the drawer on December 1.
>
> Thanks for any suggestions.
> Kathleen in Maryland
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar