 | 
28-Jul-2006, 08:39 AM
|  | Guest | | | | | | | | | | Date criteria with any day Hello,
I'm looking to open a report using a line of code like this:
DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
"tblGages.LastCalib = #" & Month & "/1/" & Year &
"#"
where Month and Year hold numeric values entered by the user. I have
the "1" there right now as a temporary character. I'm looking to make Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13695-date-criteria-with-any-day.html
it so the criteria uses that Month and Year value, but works for any
day. I thought of some solutions but ran into the problem that some Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
months have 29, some 30, some 31, days.
Thanks for any help. Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh! | 
28-Jul-2006, 08:39 AM
|  | Guest | | | | | | | | | | RE: Date criteria with any day DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
"(Month(tblGages.LastCalib) = " & Month & "and Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
year(tblGages.LastCalib) = & Year &")"
"Garret" wrote:
> Hello,
>
> I'm looking to open a report using a line of code like this:
>
> DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
> "tblGages.LastCalib = #" & Month & "/1/" & Year & Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
> "#"
>
> where Month and Year hold numeric values entered by the user. I have
> the "1" there right now as a temporary character. I'm looking to make
> it so the criteria uses that Month and Year value, but works for any
> day. I thought of some solutions but ran into the problem that some
> months have 29, some 30, some 31, days.
>
> Thanks for any help.
>
> | 
28-Jul-2006, 08:39 AM
|  | Guest | | | | | | | | | | Re: Date criteria with any day Thanks, it was just what I wanted. I ended up using this statement:
DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
"(Month(tblGages.LastCalib) = " & Month & _
"and Year(tblGages.LastCalib) = " & Year & ")" Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
It turns out that you left out some quotation marks. Thanks bunches
though!
schasteen wrote:
> DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
> "(Month(tblGages.LastCalib) = " & Month & "and
> year(tblGages.LastCalib) = & Year &")"
> | 
28-Jul-2006, 08:39 AM
|  | Guest | | | | | | | | | | Re: Date criteria with any day Sorry , sometimes my typing get ahead of my brain.
"Garret" wrote: Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
> Thanks, it was just what I wanted. I ended up using this statement:
>
> DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _ Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13695
> "(Month(tblGages.LastCalib) = " & Month & _
> "and Year(tblGages.LastCalib) = " & Year & ")"
>
> It turns out that you left out some quotation marks. Thanks bunches
> though!
>
> schasteen wrote:
> > DoCmd.OpenReport "rptMontlyCalibration", acViewPreview, , _
> > "(Month(tblGages.LastCalib) = " & Month & "and
> > year(tblGages.LastCalib) = & Year &")"
> >
>
> | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | » Books You Should Read... | | | |