convert 和 grid问题

bl_xin 2004-09-29 04:08:46
日期格式的字段convert(char,' ',120)成字符串出来格式是yyyy-mm-dd 比如今天是2004-09-29,但是直接从数据库返回到grid里面他自己省略了那个0,成了2004-9-29,两者不一致了,有什么办法一致起来?
...全文
111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
bl_xin 2004-09-29
  • 打赏
  • 举报
回复
convert(char,' ',120),沒有指明長度不對﹐應該convert(char(10),' ',120)

你的"2004-09-29"橫杠是兩個字符串﹐應該是"2004-09-29"

我是写的太快了为了省事,这辆个问题我都知道,不存在的。

至于你说系统日期格式,我不太懂。不过数据库里面就是2004-9-29的格式(datetime)格式,想变成09都不行,但是convert却是2004-09-29,郁闷。
Andy__Huang 2004-09-29
  • 打赏
  • 举报
回复
convert(char,' ',120),沒有指明長度不對﹐應該convert(char(10),' ',120)

你的"2004-09-29"橫杠是兩個字符串﹐應該是"2004-09-29"

你變換看﹗
select covnert(varchar(10),"2004-09-29",120)


//但是直接从数据库返回到grid里面他自己省略了那个0,成了2004-9-29
那是你的系統日期格式問題
UVTools are a set of software utilities to play, convert and analyze YUV or RGB video data in their raw formats. The main features of YUVTools are: It accepts (plays, converts, edits and analyzes) the combination of following formats: YUV in 4:4:4, 4:2:2 or 4:2:0 sample format, RGB in 4:4:4 sampling format; in different component order, like YUV, YVU, UYV, RGB, BGR, etc. in progressive (one single frame) or interlaced (two fields) format; in planar (YYY...UUU...VVV...) or packed (YUV, YUV....) pixel format; in predefined or arbitrary resolutions; Support FOURCC ( refer to: http://www.fourcc.org/). An image preview function to help guess the video format interactively. YUV Player can open multiple player dialogs and play different files in each dialog separately, or play multiple video files in one player dialog one by one sequentially. The detailed format of any opened or generated files will be logged, and the user can directly select any file to play back from the history list. YUV Converter can convert any combination of the format to another format, or convert to (or from) a sequence of BMP files. Other conversion functions include: scaling, join, crop, flip, padding, merge and separation of color components. YUV Analyzer can be used to calculate PSNR between two YUV files, or compare pixel by pixel to check the difference between the corresponding frames of two files, or overlay block type or motion vectors on top of each frame. Another useful feature is to help check the motion between two adjacent frames. YUV Editor can be used to edit the images pixel by pixel, or overlay one YUV image on top of another YUV image file. Convert YUV file to AVI format or vice versa; Setting options include grid display, different YUV to RGB conversion formula, etc. Many of above functions can also be performed in command line mode, which are useful for batch process or scripting.

34,587

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧