Sabtu, 19 Januari 2019

Re: [MS_AccessPros] DatePart Criteria doesn't work.

 

hi Kevin,

another thing you can try is setting the data type to be Integer for [Forms]![frmOfficeLocationProfit]![MonthCalc] in the query Parameters

or perhaps surround NZ with CInt to convert to integer

~crystal


On 1/19/2019 11:14 PM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] wrote:
Kevin,

What happens if you open the debug window (press Ctrl+G) and enter:
? DSum("AmountFinal","qryManagerialCostCalc","ActualMonth=1")

What is the SQL view of qryManagerialCostCalc?

What do you see if you create a new blank query and enter this SQL:

SELECT Sum(AmountFinal) as TotalFinalIn FROM qry ManagerialCostCalc WHERE ActualMonth = 1;

Regards,
Duane


From:� Qingqing qingqinga@yahoo.com
Sent: Saturday, January 19, 2019 11:02 PM
�
Dear All,
I tried to use DatePart('m',MyDate) to get the month,in a query, it worked fine. But when I apply the month as criteria in a form, it didn't work. after running the query, the result is bland, containing no record. Here's what I have in a form query:

TotalFinalIn: DSum("AmountFinal","qryManagerialCostCalc","ActualMonth=" & Nz([Forms]![frmOfficeLocationProfit]![MonthCalc],0))

The MonthCalc in the form is unbound text box. and on the form load event I use: Me.MonthCalc=Month(Date), I want to calculate the total managerial cost in the current month.

Please help.
Best Regards,
Kevin


__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar