>I have a problem with select records from table.
>There are one record in table mydb.dbo.R_mytable with datetime field
>mydatetime={25.07.2006 12:27}
>
>But SQL-command:
>select * from mydb.dbo.R_mytable where mydatetime between
>convert(datetime,'05.07.2006',104) and convert(datetime,'25.07.2006',104)
>
>not find records.
>
>Please help.
This SELECT will not find any records, becuase you search for records between:
05.07.2006 00:00:00 and 25.07.2006 00:00:00
but your records are after 25.07.2006 00:00:00 -> 25.07.2006 12:27:00
If you don't want time portion to take a place in SELECRT change it to:
select *
from mydb.dbo.R_mytable
where convert(varchar(8),mydatetime,112) between '20060705' AND '20060725'
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.