Skip to main content
October 22, 2008
Answered

Using DateAdd and getting Null Pointer Error

  • October 22, 2008
  • 2 replies
  • 334 views
I am using the following code below:

<cfoutput query="getpeople">
<cfset time2 = TimeFormat(getpeople.lunch_out_time, "hh:mm")>
<!---<cfset time3 = DateAdd("h", 0, time2)> --->
<cfset time4 = DateAdd("n", 10, time2)>

I have commented out the adding 0 hours and am trying to add 10 minutes to time2 a variable that is set by getting a value from a database however when I try and do this I get a

The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.

Please help, thanks!
    This topic has been closed for replies.
    Correct answer
    No the issue was that I had someone in the dateabase with no time listed so that was the issue. Took care of it and it's working fine now :-) Thanks for the thought.

    2 replies

    Correct answer
    October 22, 2008
    No the issue was that I had someone in the dateabase with no time listed so that was the issue. Took care of it and it's working fine now :-) Thanks for the thought.
    Inspiring
    October 22, 2008
    timeformat returns a string which means you can't apply date functions to it.