如何在sybase中将字符串转换为日期 [英] How to convert a string to a date in sybase

查看:75
本文介绍了如何在sybase中将字符串转换为日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 sybase where 子句中指定一个日期值.例如:

I need to specify a date value in a sybase where clause. For example:

select * 
from data
where dateVal < [THE DATE]

推荐答案

使用convert函数,例如:

Use the convert function, for example:

select * from data 
where dateVal < convert(datetime, '01/01/2008', 103)

转换样式 (103) 决定要使用的日期格式.

Where the convert style (103) determines the date format to use.

这篇关于如何在sybase中将字符串转换为日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆