You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Nic Werner <ni...@link11.net> on 2003/10/06 00:36:16 UTC

Determine if database field is a date

Greetings,
   I'm dynamically creating a table from user-selected columns. Meaning,
from a drop down box the user selects which things they want in their
report (First Name, Doctor etc) and JSTL does a query with those and
creates a table from it.

However, since the table is dynamic, I'm having trouble figuring out which
field is a date so I can apply date formatting (remove timestamp).

I tried parsing out the column names and if it contained 'date', save that
index to a variable and when I displayed the database data, if the current
column matched that variable, format for date.

 However, that only works for one date field, not multiples.

Any suggestions?

- Nic




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Determine if database field is a date

Posted by Serge Knystautas <se...@lokitech.com>.
Nic Werner wrote:
> I tried parsing out the column names and if it contained 'date', save that
> index to a variable and when I displayed the database data, if the current
> column matched that variable, format for date.
> 
>  However, that only works for one date field, not multiples.

Err, I'm probably misunderstanding this, but this seems like a 
fundamental programming issue.  If you only keep ONE variable with a 
column index/name that is a date, you will only be able to track one 
column as a date field.  Why not try using a collection or array of indexes?

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org