in reply to Returning a value from a sub routine

Also of note, the 'return $sqltoday' line will return the first element of the final line of your '$dbhdt->dbnextrow' query. For example if the data were like this:
Field1 Field2 Field3 bill smith 32 bob jones 43
your return would be 'bob' If that final line had no value in the first position you would return nothing, like this:
Field1 Field2 Field3 bill smith 32 jones 43
this would return '' in '$sqltoday'; Note, this is just a guess since I do not know your data setup. -Chad