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.
Author |
Topic |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-15 : 02:15:02
|
Hi all,i have executed one query on ORACLE Server i got below output.select * from openquery(finuat,'select (trunc(sysdate, ''MONTH'') - 1) from dual ')output is: 2013-01-31 00:00:00.0000000.we are trying but getting wrong datapls provide the Convertion function in sql server |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-15 : 02:27:34
|
what should be your required output? i think it returns correct result as per expression used------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-02-15 : 02:32:03
|
we fetchig in oracle query 2013-01-31my MSSql query need to fetch the same figure.mohan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-15 : 02:57:19
|
in sqlserver you needDATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)-1------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-02-15 : 07:39:44
|
quote: Originally posted by kond.mohan we fetchig in oracle query 2013-01-31my MSSql query need to fetch the same figure.mohan
If you need only DATE part, use convert function or do it in a front end applicationMadhivananFailing to plan is Planning to fail |
|
|
|
|
|