Convert DateTime field to short date

I'm trying to figure out how to accomplish this using SQL Server
Query builder for a local package

convert(varchar,dbo.CMC_CLCL_STATUS.CLST_STS_DTM,101)

I get an error Function agrument count error.
LVL 1
DYOUNG1006Asked:
Who is Participating?
 
srafi78Connect With a Mentor Commented:
convert(varchar(10),dbo.CMC_CLCL_STATUS.CLST_STS_DTM,101) for date to be returned in MM/dd/yyyy format
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
The following converts the current date and time and also displays the current datetime in default format.

The one thing you didn't mention was the format of your datafield that you are converting.

Select convert(varchar,getdate(),101), getdate()
0
 
DYOUNG1006Author Commented:
my table and field is
dbo.CMC_CLCL_STATUS.CLST_STS_DTM

I've tried varchar(10), (20), and (30).
In addition I can't use getdate(), or dont believe I can because I need the value in CLST_STS_DTM not the general system date.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
srafi78Commented:
Is this a datetime field? Try converting the column into datetime first
CAST(dbo.CMC_CLCL_STATUS.CLST_STS_DTM as DATETIME)
0
 
DYOUNG1006Author Commented:
yes the field is DateTime

While in my local package
while in Transform Data Task Properties
Destination tab
field CLST_STS_DTM Type show datetime
0
 
srafi78Commented:
Maybe you should try
convert(DateTime,dbo.CMC_CLCL_STATUS.CLST_STS_DTM,101)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.