You are here: Re: CONVERSION FROM CHAR(4) TO DATETIME « MsSQL Server « IT news, forums, messages
Re: CONVERSION FROM CHAR(4) TO DATETIME

Posted by othellomy on 11/23/06 07:17

You can try something like:

select *
from sometable
where convert(datetime, '20060101 ' + J_TIM) <
convert(datetime,'20060101 ' + substring(F_TIM,1,2) + ':' +
substring(F_TIM,3,2))

paul_zaoldyeck wrote:
> i have another problem.and it's now on converting a char(4) to datetime
> here is the situation
> J_TIM < F_TIM
>
> J_TIM is datetime while F_TIM is char of 4
>
> example
>
> J_TIM = 20:30
> F_TIM = 2030
>
> how can i convert F_TIM to datetime so that i can compare them.
> ???
>
> thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация