Hi All,

I've tried the following to format my date in 'dd/mm/yyyy' instead of 'dd/mm/yyy hh:mm:ss' when importing data from csv to DataSet.

CONVERT(VARCHAR(10), [dateColumnName], 103) AS [DD/MM/YYYY]

and

CONVERT(DATETIME, [dateColumnName], 101) AS [DD/MM/YYYY]

Both give me the error: Undefined function 'CONVERT' in expression

What would be the correct method for this?

The full query is:

SELECT DISTINCT(URN), [CanX Reason], CONVERT(DATETIME, [Date to take effect?], 101) AS [DD/MM/YYYY] FROM...

Yeah, the first looked fine to me too.
I'm using Microsoft.Jet.OLEDB.4.0.

I'm going to take a different approach as the main problem (the date formatting) is occurring when I create a new csv file from the DataSet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.