WEEK function using MySQL

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
autonomy2
Posts: 65
Joined: Thu May 18, 2006 10:58 am
Location: Sydney

WEEK function using MySQL

Post by autonomy2 »

Hello Support.

Would you have any advice for the following:

My application is using an attribute in Business Object A to store the number of instances found matching certain criteria in Business Object B.

The following works using the default Derby database but won't work using MySQL (MySQL 5.1.19).

BusinessObject_A.Qty = COUNT BusinessObject_B WHERE
(BusinessObject_B = LoggedInSystemUser.BusinessObject_Focus AND

WEEK(DATE_PART(BusinessObject_B.InstanceTimeStamp)) = CURRENT_WEEK AND
YEAR(DATE_PART(BusinessObject_B.InstanceTimeStamp)) = CURRENT_YEAR)

Thanks.
autonomy2
Posts: 65
Joined: Thu May 18, 2006 10:58 am
Location: Sydney

Week Function

Post by autonomy2 »

Hi Support.

Do you have information in regards to my original post?
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Should work in theory - have a look at the LogViewer and check what it returns for the WEEK function.
Aware IM Support Team
ACDC
Posts: 1143
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Post by ACDC »

I had a similar problem to this and could not find a solution. However I was able to get around the problem by creating an Attribute "CurrentWeek" and then updating it with a rule using CurrentWeek=Current_Week

Then in your rule refer to the Attribute CurrentWeek instead of Current_Week

hope that makes sense
Post Reply