Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing a date variable

Status
Not open for further replies.

raskew

Programmer
Oct 18, 2000
488
Brain cramp time-

Have dimensioned a variable as date. Am running through a looping procedure where a date value is stored to the variable. Need to clear the variable after each iteration (to avoid bringing in the previous value). nextHold = Null produces an "Invalid use of null" error and, after about 14 hours of writing code, I'm coming up with a zero as to the correct syntax.

Know this is absolutely elementary, and if I waited till morning the solution would slap me upside the head. Unfortunately, I need to keep moving with this project and if someone would be so kind to point out the obvious, I'd appreciate it.

Thanks,

Bob


 
Hi Bob,

You aren't going to be able to "Clear" the variable with a Null value. To clear it, you will have to settle for handling a 0 value for the date in your code. You can also, however, assign a Null to those date fields in your database to clear them.

Gary
gwinn7
 
Gary-

Apoligize for the slow response. Your info is absolutely correct. It turned out that I'd painted myself into a corner with my code. Had to back up and take a different approach. Your response showed me the error of my ways, which was what I was looking for.

Many thanks,

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top