Skip to main content
Inspiring
April 8, 2011
Answered

Passing the timestamp

  • April 8, 2011
  • 1 reply
  • 887 views

I've discovered an interesting problem where suggested solutions don't seem to work.

I need to pass a DB2 timestamp to a module.  Here's what I've been trying:

The timestamp from the table is "2011-04-08 08:21:09.995639"

I use URLEncodeFormat to change the spaces, and prepare to pass "2011%2D04%2D08%2008%3A21%3A09%2E995639"

<cfset templeaveid =  #URLEncodedFormat(timestamp)# />

The passing code is:

<a href="dsp_pleave_edit.cfm?leaveid=#templeaveid#">Update</a>

When I get to the dsp_pleave_edit.cfm module, I dump the value (because I keep getting nothing) an lo! and behold, it's an empty string!  Yes, I've tried it in ts raw form and decoded form.  Both give the empty string.

<cfdump var=#URL.leaveid#><br />
<cfdump var=#URLDecode(URL.leaveid)#><br />

[empty string]
[empty string]

What am I doing wrong?  No, I cannot use another field, the timestamp is the only unique row identifier on this table.  This is definitely a stumper!

This topic has been closed for replies.
Correct answer Dan_Bracuk

Is that anchor tag inside a cfoutput block?

1 reply

Inspiring
April 8, 2011

Pass it as a numeric string.  When you receive it, use ParseDateTime to change it back to a timestamp.

sockerdadAuthor
Inspiring
April 8, 2011

OK, I converted the date to a straight numeric string:

<cfset tstampDate =
     Left(#get_personal_leave.ROW_ADD_TSTAMP#, 4)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 6, 2)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 9, 2)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 12, 2)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 15, 2)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 18, 2)
  & MID(#get_personal_leave.ROW_ADD_TSTAMP#, 21, 6)/>

<cfdump var=#tstampDate#>

Which gives me:  20110408082109995639

and I still passed nothing.  So I tried a U in front of the string (for Update), and all I got was the U!  It's not passing the field's value. Why?  The production example I copied worked great:

PROD:

  <a href="dsp_employee_edit.cfm?userid=U#get_isb_employees.USER_ID#">Update</a>

Mine

  <a href="dsp_pleave_edit.cfm?leaveid=U#tstampDate#">Update</a>

And I use identical code on the receiving end (<cfdump var=#URL.userid#><br />) to see what I passed.

I noticed that the IE address bar shows the field for the production as:

dsp_employee_edit.cfm?userid=UMV370

but mine is showing as:

dsp_pleave_edit.cfm?leaveid=U#tstampDate#

This suggests that the value within the pound signs isn't being translated to any sort of a value.  What would cause that?

Dan_BracukCorrect answer
Inspiring
April 8, 2011

Is that anchor tag inside a cfoutput block?