JoseDavila
asked on
Converting SQL or Access Date to mm-dd-yyyy hh-mm-ss
In MS Access, I have created a Linked TABLE. This table is linked to a table in an MS SQL table.
One of the columns is called StartTime.
For the date 10/29/04 08:31:13 the table shows a value of 1099063873. I need the value after I query the table be shown as
mm/dd/yy hh:mm:ss
What is the function that I can use in a SQL statement when querying the linked table that returns this format?
One of the columns is called StartTime.
For the date 10/29/04 08:31:13 the table shows a value of 1099063873. I need the value after I query the table be shown as
mm/dd/yy hh:mm:ss
What is the function that I can use in a SQL statement when querying the linked table that returns this format?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
is start_time a date field? if so ditch the cdbl and /86400. You don't need them....
oh and if you want to get fancy, change the linked table to a pass through query and put the view onto the sql box, it ought to run quicker that way, then you'llw ant to use the other formatting trick:
select Convert (varchar(17), [Start_date], 01) + ' ' + Convert (varchar(17), [Start_date], 108)
from [inspectiondata Macro T1]
(When using Access backended onto sql linked tables are often the slowest way of doing things. A stored proc or view will be better)
select Convert (varchar(17), [Start_date], 01) + ' ' + Convert (varchar(17), [Start_date], 108)
from [inspectiondata Macro T1]
(When using Access backended onto sql linked tables are often the slowest way of doing things. A stored proc or view will be better)
ASKER
It ended up looking like:
Format(CDbl(([dbo_inspecti