Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Tuesday, March 27, 2012

Datatime order by Problem

Hi everybody,
I have onde table called (TB) with two fields : F1(int) and F2(varchar:10)
In this table the field F2 is used to store dates in the format
dd/mm/yyyy (27/12/2002). Its is record as varchar and undesired.
I need to select all records from a single id from the field F1 and
then order by the result set by date to result set be this way:

F1 F2
------------
01 15/12/1975
01 15/12/1980
01 16/12/1998
01 27/12/2003
------------

To do this Im using the follow syntax :

SELECT * FROM TB
WHERE (F1 = '01')
ORDER BY CAST(F2 AS datetime(103))

But it gives the follow message erro trying to select data :

[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

How can I convert the format used in the select to order by date type in a SQL Server range datetype to get a result set as above?

Thansk for attention.

Leonardo AlmeidaUse convert(datetime, f2, 103) instead of the cast.sql

Wednesday, March 21, 2012

DataSet

Hi everybody!
Can we Have two or three DataSet in one list?
...No. However, you can have subreports which might accomplish what you are
trying to do.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<shima.seifolahi@.gmail.com> wrote in message
news:05a53d47-9654-45d4-8d55-4ee658f4464a@.34g2000hsf.googlegroups.com...
> Hi everybody!
> Can we Have two or three DataSet in one list?
> ...