Skip Ribbon Commands
Skip to main content

Erin Glenn's Blog

:

Erin Glenn's Blog > Posts > Formatting a Date Field in Nintex Form SQL Request Control
February 08
Formatting a Date Field in Nintex Form SQL Request Control

I needed to return a date in a SQL query using the Nintex Form SQL Request Control.  I can do this via a simple SQL query. However, the returned format is:

10/31/2016 12:0​0:00 AM

I need it to be 10/31/2016.

Yes, I can create a calculated control to format this SQL Request Control, but then I have to "hide" the control and only display the calculated control. What a pain!

I found that I can convert the date field in the SQL query to the format I need!​

SQL query before:

Select EnrollmentStartDate
V_ActiveSEParticipantEnrollment
Where ParticipantID='SQLID_Participant'

SQL query after:

Select convert (varchar, EnrollmentStartDate, 101) AS EnrollmentStartDate
From V_ActiveSEParticipantEnrollment
Where ParticipantID='SQLID_Participant'

​Both the Value and Display field in the SQL Request Control settings are "EnrollmentStartDate".

Here's the reference to the date formats used in the Convert command. (The number referenced after the field.)

Comments

There are no comments for this post.