| Author |
Topic  |
|
|
Pete_N
Posting Yak Master
117 Posts |
Posted - 03/06/2013 : 06:09:53
|
I have two tables both with smalldatetime fields
Select MyTime from Table1.dbo.Test returns '2010-01-28' Select MyTime from Table2.dbo.Test returns '2010-28-01'
what is the query to return Table1,dbo.test back as 2010-28-01 and I need to do date comparasions between data in the two tables |
|
|
MIK_2008
Aged Yak Warrior
Pakistan
823 Posts |
Posted - 03/06/2013 : 06:39:11
|
table1.dbo.test, Is table1 is Schema? If no - its a table, then how come it executed?
when both tables are having "smalldatetime" fields then how those columns hvae returned the date in two different formats? Not possible in my openion with SQL server. SQL server dates data type stores data in the format of YYYY-MM-DD
Cheers MIK |
Edited by - MIK_2008 on 03/06/2013 06:39:41 |
 |
|
|
Pete_N
Posting Yak Master
117 Posts |
Posted - 03/06/2013 : 07:13:24
|
Hi,
I have sorted it. one of the tables was loaded by importing a XML file. The text date was applied to a function but when converting into the table I was using CONVERT( SMALLDATETIME, (SELECT SQLProcesses.dbo.func_ProcessingDate_To_ClearedFundsDate(g.c.value('(@uhl1ProcessingDate)','varchar(32) ' ))), 103),
instead of
CONVERT( SMALLDATETIME, (SELECT SQLProcesses.dbo.func_ProcessingDate_To_ClearedFundsDate(g.c.value('(@uhl1ProcessingDate)','varchar(32) ' ))), 120),
It's always helps to bounce some problems off people , it focuses the mind and thing become clearer
|
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47069 Posts |
Posted - 03/06/2013 : 11:43:04
|
whatever you're telling doesnt make any sense 120 gives yyyy-mm-dd which will be 2010-01-28 and 103 will give it in dd/mm/yyyy format
ie 28/01/2010
2010-28-01 is not a valid date format in SQL server
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
| |
Topic  |
|