Senin, 21 Mei 2012

[AccessDevelopers] Re: query

 

I tried using a Table instead of Form to hold the date.

No problem with > or < date
FROM tbl_Transactions, Table2
WHERE (((tbl_Transactions.TransDate)<[table2].[Field1]));

But I faced problems with between two dates
FROM tbl_Transactions, Table2
WHERE (((tbl_Transactions.TransDate) Between #[table2].[Field1]# & "And" & #[table2].[Field2]#));

Any idea what was wrong?

Regards, jay lim

--- In AccessDevelopers@yahoogroups.com, Duane Hookom <duanehookom@...> wrote:
>
>
> Deanna welcome to the group.
>
> The actual criteria for between would be:
> Between Forms![Form Name]!StartDate And Forms![Form Name]!EndDate
> Your expression can be used to display the date range in a text box in the report.
>
> There are some additional challenges if your date format is not m/d/y. Allen Browne has a good page regarding this at http://www.allenbrowne.com/ser-36.html.
>
> Duane Hookom
> MS Access MVP
>
>
>
> To: AccessDevelopers@yahoogroups.com
> From: deanna.scheffe@...
> Date: Mon, 21 May 2012 08:42:51 -0500
> Subject: Re: [AccessDevelopers] query
>
>
>
>
>
> You can have a form come up and enter the date in the form. You can then reference the field from the form in all your queries. Below is code you can use in a report if you want your report to run between a start and ending date.
>
>
>
>
> =Forms![Form Name]!StartDate & " - " & Forms![Form Name]!EndDate
>
>
>
> Deanna Scheffe
> 940-592-2111 Ext. 306
> "A man sees in the world what he carries in his heart." -Opening Scene of Faust
>
>
>
> On Mon, May 21, 2012 at 8:40 AM, Jay <jaykay@...> wrote:
>
>
>
>
>
>
> I had a few queries for information on tbl_transactions based on certain date. Is there a way to have this date keyed once and allow the queries to obtain this date, instead of opening up each query and make the change in the criteria box?
>
> Regards, jay lim
>

__._,_.___
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___

Tidak ada komentar:

Posting Komentar