From: João A. <jja...@gm...> - 2010-09-07 20:54:46
|
@Gwen: Indeed the correct one is date_sub. Though the function arguments don't seem to match the ones in the makumba page. @Cristi: So, if this will not work in paraDe, any suggestion on which approach I should take to solve this problem? :) thanks, João Andrade On 7 September 2010 21:43, Cristian Bogdan <cr...@cs...> wrote: > and of course > - it should be a 0.9 makumba version or later > - and this does not work in HQL (i.e. not in parade) > > cristi > > > Gwenael Alizon wrote: > >> The correct link would be: >> >> http://www.makumba.org/page/QueryLanguages#section-QueryLanguages-MQLFunctions >> >> now looking at what functions are available there, you might want to >> try *date_sub* instead of dateSub >> >> Cheers, >> Gwen >> >> >> On Tue, Sep 7, 2010 at 10:23 PM, João Andrade <jja...@gm...> >> wrote: >> >>> Hey, >>> >>> Thanks for the replies! >>> >>> Still no luck: >>> >>> <mak:value expr="dateSub(current_date(), 6, 'month')" var="foo"/> >>> >>> Returns: >>> >>> MQL Function 'dateSub' is not defined as query fragment, nor is it a >>> known >>> MQL function! Please refer to >>> http://www.makumba.org/makumba-spec.html#tab_ql for a list of known >>> functions. >>> >>> Should I be including some taglib in order to use MQL functions? >>> >>> >>> p.s. The link in the error message isn't working. >>> >>> Cheers, >>> >>> João >>> >>> On 7 September 2010 19:17, Manuel <ma...@ma...> wrote: >>> >>>> hi, >>>> >>>> <mak:value expr="date_sub(current_date(), INTERVAL 6 MONTHS)" >>>>>> var="foo"/> >>>>>> <mak:if test="$foo > $eventDate"> >>>>>> >>>>> makumba doesn't support the INTERVAL 6 MONTHS syntax of mysql (the doc >>>> should be updated about this). >>>> >>>> I think there's a mql specific function called dateSub which works like >>>> this: >>>> >>>> (copied straight from the tests): >>>> >>>> +1 year: <mak:value expr="dateAdd($someDate, 1, 'year')"/> <br/> >>>> -1 year: <mak:value expr="dateAdd($someDate, -1, 'year')"/> <br/> >>>> +2 year: <mak:value expr="dateSub($someDate, 2, 'year')"/> <br/> >>>> +14 days: <mak:value expr="dateSub($someDate, - 14, 'day')"/> <br/> >>>> -14 days: <mak:value expr="dateSub($someDate, 14, 'day')"/> <br/> >>>> >>>> manu >>>> >>>> 2010/9/7 "Orel (Aurélien Delcroix)" <or...@be...>: >>>> >>>>> Hi, >>>>> >>>>> Have you tried MONTH instead of MONTHS? >>>>> >>>>> MONTHS isn't in the list there: >>>>> >>>>> >>>>> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-add >>>>> >>>>> Hugs, >>>>> Orel >>>>> >>>>> On 06/09/10 23:57, João Andrade wrote: >>>>> >>>>>> Hello there! >>>>>> >>>>>> I think I might have a small issue here. >>>>>> >>>>>> In want to check if a given date is more than six months behind the >>>>>> current date. >>>>>> >>>>>> I tried the function date_sub (which can be found under query >>>>>> languages on the makumba page) and wrote something along the lines of >>>>>> the following piece of code: >>>>>> ... >>>>>> <mak:value expr="date_sub(current_date(), INTERVAL 6 MONTHS)" >>>>>> var="foo"/> >>>>>> <mak:if test="$foo > $eventDate"> >>>>>> ... >>>>>> </mak:if> >>>>>> ... >>>>>> >>>>>> Somehow the 'expr unit' part isn't recognized. >>>>>> >>>>>> I tried some other approaches, but they required me to cast an int (6 >>>>>> in this case) to date and I can't seem to find a way to do it. >>>>>> >>>>>> What exactly am I doing wrong? >>>>>> >>>>>> Thanks in advance, >>>>>> >>>>>> João Andrade >>>>>> >>>>> -- >>>>> Orel - orel@BEST.eu.org >>>>> "First they ignore you, then they laugh at you, then they attack you, >>>>> then you win." >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> This SF.net Dev2Dev email is sponsored by: >>>>> >>>>> Show off your parallel programming skills. >>>>> Enter the Intel(R) Threading Challenge 2010. >>>>> http://p.sf.net/sfu/intel-thread-sfd >>>>> _______________________________________________ >>>>> Makumba-devel mailing list >>>>> Mak...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/makumba-devel >>>>> >>>>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net Dev2Dev email is sponsored by: >>> >>> Show off your parallel programming skills. >>> Enter the Intel(R) Threading Challenge 2010. >>> http://p.sf.net/sfu/intel-thread-sfd >>> _______________________________________________ >>> Makumba-user mailing list >>> Mak...@li... >>> https://lists.sourceforge.net/lists/listinfo/makumba-user >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> This SF.net Dev2Dev email is sponsored by: >> >> Show off your parallel programming skills. >> Enter the Intel(R) Threading Challenge 2010. >> http://p.sf.net/sfu/intel-thread-sfd >> _______________________________________________ >> Makumba-devel mailing list >> Mak...@li... >> https://lists.sourceforge.net/lists/listinfo/makumba-devel >> > > |