November 27, 2015 at 1:04 am
Hi all,
Help me please,
How i can get only the date form this statment:
select distinct po_id po_id, dc_id,whse_id wh,trunc(create_dtim) data from irctl where (extr_flag is null or extr_flag ='N') and create_dtim < today and rct_qty > 0 order by trunc(create_dtim)
For now return this value:
16-11-2015 00:00:00
Already try the to_char(create_dtim, "%d %B %Y") but have a error i my Visual Studio π (Does not allow the character%)
Thks a lot,
Cachado
November 27, 2015 at 1:31 am
Is your query a T-SQL statement?
Igor Micev,My blog: www.igormicev.com
November 27, 2015 at 2:48 am
Hi,
DonΒ΄t work π with this FORMAT(GETDATE(create_dtim),'dd-MM-yyyy') !!
ERROR [HY000] [INTERSOLV][ODBC Informix driver][Informix]Procedure (getdate) not found.
Regards,
Cachado
November 27, 2015 at 3:37 am
BrainDonor (11/27/2015)
That was just an example, using a SQL Server date function.What does
FORMAT(create_dtim,'dd-MM-yyyy')
do?
no π
ERROR [HY000] [INTERSOLV][ODBC Informix driver][Informix]Procedure (format) not found.
Regards,
Cachado
November 27, 2015 at 3:47 am
You may be best posting this on an IBM Informix forum instead of a Microsoft SQL Server forum.
November 27, 2015 at 8:02 am
BrainDonor (11/27/2015)
That was just an example, using a SQL Server date function.What does
FORMAT(create_dtim,'dd-MM-yyyy')
do?
Just so you know, FORMAT is 44 times slower than either CAST or CONVERT.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 27, 2015 at 8:17 am
Jeff Moden (11/27/2015)
BrainDonor (11/27/2015)
That was just an example, using a SQL Server date function.What does
FORMAT(create_dtim,'dd-MM-yyyy')
do?Just so you know, FORMAT is 44 times slower than either CAST or CONVERT.
Thks for your help....still find the solution for me π
Regards,
Cachado
November 27, 2015 at 8:36 am
jcachado (11/27/2015)
Thks for your help....still find the solution for me πRegards,
Cachado
The error your getting is an Informix error not a Microsoft SQL Server error.
I would suggest posting this on an Informix forum or taking a look in the informix documentation on converting date time fields.
https://www-01.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sqlr.doc/ids_sqr_171.htm
November 27, 2015 at 8:40 am
jcachado (11/27/2015)
Jeff Moden (11/27/2015)
BrainDonor (11/27/2015)
That was just an example, using a SQL Server date function.What does
FORMAT(create_dtim,'dd-MM-yyyy')
do?Just so you know, FORMAT is 44 times slower than either CAST or CONVERT.
Thks for your help....still find the solution for me π
Regards,
Cachado
I don't even know how to spell "Informix". This is a Microsoft SQL Server site. As others have stated, you should probably look for an "Informix" site/forum to get help with this problem.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 27, 2015 at 9:30 am
Still searching...
TO_CHAR(create_dtim, '%m-%d-%y')
Returns the strange error:
ERROR [HY000] [INTERSOLV][ODBC Informix driver][Informix]Unknown error message -19828.
Regards,
Cachado
November 27, 2015 at 11:40 am
jcachado (11/27/2015)
Still searching...TO_CHAR(create_dtim, '%m-%d-%y')
Returns the strange error:
ERROR [HY000] [INTERSOLV][ODBC Informix driver][Informix]Unknown error message -19828.
Regards,
Cachado
TO_CHAR is an Oracle SQL function. This is a SQL Server forum.
If you're querying a SQL Server 2008 database (assumption based on the forum this question is posted in) then try CAST or CONVERT.
https://msdn.microsoft.com/en-us/library/ms187928.aspx
Looking at your error, I've never heard of using an Informix ODBC driver to access SQL Server before. If you're trying to query something other than SQL Server, then I suggest you look for a forum devoted to the appropriate database.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply