PDA

View Full Version : Solved: Changing Date Format Within an Array



mferrisi
04-10-2007, 02:29 PM
I created an array via database query

databasename = DbConnectionHF 'This goes to the database function
querystring = "SELECT the_name, the_id, the_date, the_period, the_mny FROM TheDatabase.TheDatabase"
MyArray = sqlrequest(databasename, querystring, , 4, False)


In MyArray(x, 3) I have a date that is like this 3/1/2005 0:00
and I need every one to be in "yyyy" format.

Is there a simple way to do this, like setting the formats for each cell in the 3rd column in the array?

Thank you

Bob Phillips
04-10-2007, 02:43 PM
Why not change the query to just get the year of the date?

mferrisi
04-10-2007, 02:48 PM
how would i do that?

Bob Phillips
04-10-2007, 03:07 PM
querystring = "SELECT the_name, the_id, YEAR(the_date), the_period, the_mny FROM TheDatabase.TheDatabase"