Avatar of Abiel de Groot
Abiel de GrootFlag for Spain asked on

TSQL Convert SQL smalldatetime to string for MS Access Date/Time

Hi All,

I have a stored procedure which collects a recordset which populates and array. This array array in turns loops and populates an MS Access 2007 Database table.

Everything goes well right up to 'Report_DC' (Date Created). This either copies poorly or not at all. There are no NULL's all the reports have a value for this field which look like this: 2012-11-02 17:38:00

I have tries

,  CAST (rpt.Report_DC as varchar)

but it does not work. When I open the Access table I get 'XXXXXXXXXXXX'

Any ideas.

Kind regards

Abiel M de Groot Sanders
Microsoft AccessMySQL ServerMicrosoft SQL Server

Avatar of undefined
Last Comment
Abiel de Groot

8/22/2022 - Mon
Guy Hengel [angelIII / a3]

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Scott McDaniel (EE MVE )

In the receiving table in Access, what is the Data type of the field receiving the data from "Report_DC"?

When I open the Access table I get 'XXXXXXXXXXXX'
So you are getting data into the field, but it's not what you expect? You're getting the XXXXXXXXXX string instead?
Guy Hengel [angelIII / a3]

Abiel de Groot

In the meantime I overlooked the fact there were some local solutions too. As I am using ASP I was simply able to use FormatDateTime(ArrReports(3,ki),2) to parse the string.

Kind regards

Abiel M de Groot Sanders
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes