somebody has shown like this to capture the server date
is it ok to have server date like this
rsdate as adodb.recordset
Set rsdate = conn.Execute("select getdate()")
Printable View
somebody has shown like this to capture the server date
is it ok to have server date like this
rsdate as adodb.recordset
Set rsdate = conn.Execute("select getdate()")
I'm not slzamany, but I'll answer anyway.
Kaffenils: "Yes."
To expand on that a little, it is fine for SQL Server.
Based on another thread of yours, I think it is important to remind you that it will not work for Access - and there is nothing in terms of SQL that will do it (you need to use VB code to find the date/time of another machine, and you can probably find it in our CodeBank forums).
I'm not kaffenils ;)
But I would do:
to get it in a consistent format - that full GETDATE() datetime with milliseconds...Code:rsdate as adodb.recordset
Set rsdate = conn.Execute("select Convert(varchar(23),getdate(),121)")
Did you want it with time??
Otherwise you do:
That returns MM/DD/YYYYCode:rsdate as adodb.recordset
Set rsdate = conn.Execute("select Convert(varchar(10),getdate(),101)")
...but from what Si said - is this ACCESS???
szlamany
actualy when i posted this thread i had specified your name in that to answer thats y kaffenils has written like that i am not szlamany but is ll answer so you pls dont mind it
now the problems is that i m helpless with access database bcoz one of my application is running since a long and i am not in the position to change that database to sql and problem i m facing is that if client machines date gets change due to any reason than transaction are taking wrong date thats y
i wanted to use server date while inserting or updating the records in access mdb even if is use default date it ll insert the local machine date but if i select the server date capture as us said
rsdate as adodb.recordset
Set rsdate = conn.Execute("select Convert(varchar(10),getdate(),101)")
than i ll get the correct running date bcoz the access mdb is also on the same serve where the sql is
friends now tell me what is your advise
I always do let the client take care of the formatting.Quote:
Originally Posted by szlamany