Forums

dynamic dropdown with month by date

admin_wiky 22 Oct, 2014
Hi all

I have one table with some columns. One column is Date (YYYY-MM-DD) and other are some numeric values.
I need to show data for certain month ie: january, but I save to table date in form 2014-12-31 and I dont know how use it in dropdown.

any idea?
Thx
GreyHead 22 Oct, 2014
Hi homeopat,

This looks like the same question as you have in another thread?

Bob
admin_wiky 23 Oct, 2014
Ho Bob,

similar, not same .... that was general about dynamic dropdown.
GreyHead 23 Oct, 2014
Answer
Hi homeopat,

I have the same answer - if you're planning to use the month then the simplest solution is to save that column to the database as well as the date.

Otherwise you can use a Custom Code action either:

a. to build a custom MySQL query that that will extract the month from the date and GROUP BY the result; or

b. Use PHP in a Custom Code action to process the results from the CF DB Read/Load action and extract the data you need for the dynamic drop-down.

Any of these will work, which is best depends on your forms and data setup.

Bob
admin_wiky 23 Oct, 2014
Hi Bob,
I am no sure if I understand u.
U mean add one column where name of month will be saved?
GreyHead 23 Oct, 2014
Hi homeopat,

Yes.

Bob
This topic is locked and no more replies can be posted.