Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem with Date and Convert

Author  Topic 

Korigami
Starting Member

9 Posts

Posted - 2008-12-23 : 06:44:22
Hi

I am writing a query and I want to use CONVERT(date, getdate()) but I am getting the error message "Date is not a defined system type"

Anyone know how to resolve this? I'm assuming it's a config issue

Thanks!

Kori

baburk
Posting Yak Master

108 Posts

Posted - 2008-12-23 : 07:03:33
quote:
Originally posted by Korigami

Hi

I am writing a query and I want to use CONVERT(date, getdate()) but I am getting the error message "Date is not a defined system type"

Anyone know how to resolve this? I'm assuming it's a config issue

Thanks!

Kori



Try like this.

CONVERT(VARCHAR, GETDATE(), 1)

Babu kumarasamy
Go to Top of Page

Korigami
Starting Member

9 Posts

Posted - 2008-12-23 : 07:15:17
Thanks!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-24 : 04:36:26

If you want o omit time part,

select dateadd(day,datediff(day,0,getdate()),0)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -