Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Expression date conversion error

Status
Not open for further replies.

n2nuk

IS-IT--Management
Dec 24, 2002
190
GB
hi there,

I need to produce an sql expression that will give me the number of contacts between two dates. the back-end db is SQL server, but the SQL expression fails with an error that reads
'conversion failed when converting date and or tie from character string'
the sql syntax i am using is event_date_time between '2017,01,01' and '2017,01,01'

thanks in advance


 
I have never sent that syntax for a date. I have only seen '2007-01-01' or '2007/01/01' as valid date strings.
 
Fixed it, it was as simple as changing date format to 01-01-2017!

Many thanksto kray4660 for the heads up
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top