Expand my Community achievements bar.

Date retrieval oddity

Avatar

Level 1

I have a Flex 3 application retrieving data from ColdFusion.  The function in the cfc runs a simple query and returns the query to the Flex app as an arrayCollection object.  The weirdness comes into play when one or more date fields are returned.  For example, the following query returns just fine:

SELECT textField1, textField2, numberField1, numberField2 FROM someTable

The arrayCollection object contains elements corresponding to each field in the query.

However, the results from the following query are odd:

SELECT textField1, textField2, numberField1, numberField2, dateField1, dateField2 FROM someTable

The arrayCollection object contains elements corresponding to each field in the query; however, the value and type of dateField1 is not date, and the value is not the value contained in the database, whiole dateField2 is both the correct type and value .  When I examine the event.Result object in the debugger, the value of the element corresponding to dateField1 appears to be a clone of the entire database record, including the correct value for dateField1 and dateField2.

Dumping the results of the query in CF gives the expected results for both date fields.

I have been able to work around the problem by altering the query as follows:

SELECT textField1, textField2, numberField1, numberField2, dateField1 as BogusDate, dateField1, dateField2 FROM someTable

To complicate things further, this is happening in some of our development environments but not in others:

Environment

DB

CF  Version

Flex Builder  Version

Working?

Dev 1

SQL  2008

CF  8

3.3.0

No

Dev 2

SQL  2000

CF  MX7

3.3.0

Yes

Dev 3

SQL  2005

CF  8

3.0.194161

No

Dev 4

SQL2005

CF  8

3.3.0

Yes

Dev 5SQL 2008CF 83.0.2.214193No

Needless to say, this is frustrating.  Any help towards a real solution would be welcomed.

Thanks in advance,

Leighton

0 Replies