Skip to content


Date format for SQL Lookup

Arthur asked 8 years ago
Hi All,
I have setup an MSSQL lookup to retrieve a date from GP  which I want to use in my map but I am stumped with the formatting of the date.
Does anyone know how to convert the date to the correct format. I tried using the date calculation but I still get errors.

patrick answered 8 years ago
Haven’t run across this before – not sure the format of the date being returned by a SQL Lookup.  However you must be getting issues per your question.
There isn’t a way to format the returning value – and you cannot use a date format since we can’t see the result of a MSSQL Lookup.
Best bet would be to write your own vb code to connect to SQL, run the query, and retrieve the results.  Then as you have the date returned, you can format it however you like for what you need the date for.
Arthur replied 8 years ago

Hi Patrick,

I found a way around it, I basically created a view of the table I was looking at and converted the date using DOCDATE=CONVERT(VARCHAR(30),DOCDATE,103) which is DD/MM/YYYY and used Userdefined Query in the SQL lookup instead of a table.


If you would like to submit an answer or comment, please sign in to the eOne portal.