Hello,
This is doing my head in!!
I have some code that runs to populate a table. Several processes are carried out and one of them needs to get information from a function. I pass two values to this function and one is a date. This date has been formatted into dd/mm/yy format. e.g.
dteCurrent = Format (dteCurrent,"dd/mm/yy"
as it is needed in this way for several stages of the process.
It is passed to the function (called getenergy) like this:-
getenergy(strRef,dteCurrent)
getenergy has the following set up.
Public Function GetEnergy(strReference as string,dteDate as date)
during this function I need to reformat the date to americanised format for some sql ("mm/dd/yy"
so I use dteDate = format(dteDate,"mm/dd/yy"
however this seems to also format dteCurrent in the function that I called getenergy from. I've tried reformatting it at the end and it won't have it. It usually thinks mm is dd and vice versa!!
so 12th August 2003 becomes 8th December 2003 and the rest of my code crashes.
Has anyone any ideas to stop me throwing my pc out of the window and handing my notice in!!!
If you need further info (which you probably will do!) let me know.
Cheers,
Steve.
Make things as simple as possible — but no simpler.![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)
This is doing my head in!!
I have some code that runs to populate a table. Several processes are carried out and one of them needs to get information from a function. I pass two values to this function and one is a date. This date has been formatted into dd/mm/yy format. e.g.
dteCurrent = Format (dteCurrent,"dd/mm/yy"
It is passed to the function (called getenergy) like this:-
getenergy(strRef,dteCurrent)
getenergy has the following set up.
Public Function GetEnergy(strReference as string,dteDate as date)
during this function I need to reformat the date to americanised format for some sql ("mm/dd/yy"
so I use dteDate = format(dteDate,"mm/dd/yy"
however this seems to also format dteCurrent in the function that I called getenergy from. I've tried reformatting it at the end and it won't have it. It usually thinks mm is dd and vice versa!!
so 12th August 2003 becomes 8th December 2003 and the rest of my code crashes.
Has anyone any ideas to stop me throwing my pc out of the window and handing my notice in!!!
If you need further info (which you probably will do!) let me know.
Cheers,
Steve.
Make things as simple as possible — but no simpler.
![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)