Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Enhancing USING Operator.  (Read 11325 times)
David H.
Posts: 158


« on: May 12, 2009, 02:07:00 pm »

I have a feeling I might have mentioned this before, but just in case, please could you consider enhancing the USING operator? According to the docs https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/Operators.html#OP_USING, the USING operator currently supports the number and DATE datatypes (although the purpose description suggests datetimes!).

We already have low level functions https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/CExtensions.html#FMT which support DATETIME's and INTERVAL's and according to the docs also add (ww = week no) to the DATE datatype format masks.

It seems reasonable to me that it Genero (where simplicity rules right!) we should be able to use all these various formats in USING clauses directly without having to use the low level functions. I just tried ww in a DATE format and it just echoed back as ww.  Is it going to be possible to do this directly at some point in the future?

It would also be nice to have a 4GL way to convert from formatted strings to numbers/DATEs/DATETIMEs/INTERVALs using all the above formatting masks:-

    LET my_date = my_str USING "dd-mmm-yyyy"

Regards,

David
Sebastien F.
Four Js
Posts: 509


« Reply #1 on: May 13, 2009, 03:59:51 pm »

David,
You suggestion make sense, I have filed a new bug/enhancement for that: bz12947
Seb
Sebastien F.
Four Js
Posts: 509


« Reply #2 on: May 13, 2009, 04:08:29 pm »

To convert from a string to a date, we can't use the USING clause, we should rather introduce a new keyword or built-in function:

Like the SQL TO_DATE() function:

   LET my_date = TO_DATE("1998-07-07 10:24",  "%Y-%m-%d %H:%M")

Seb
David H.
Posts: 158


« Reply #3 on: May 15, 2009, 11:47:38 am »

Sounds good! I just realised I'd misread the documentation and "ww" is actually the weekday no. I would be nice if we could have an additional mask character for the week number (01-52) at some point too.

I also just noticed I posted this thread in the wrong forum section, sorry!

David
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines