基于动态对象更改值 [英] Change Value based on Dynamical Object

查看:71
本文介绍了基于动态对象更改值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Goal:
The goal is to make the variable with value '2014-06-14 09:00:00.000'

Problem:
The syntax code is created as a dynamical object how do you make it from '2014-06-14 16:20:10.000' into value '2014-06-14 09:00:00.000'?













DECLARE @a datetime = '2014-06-14 16:20:10.000'

推荐答案

Hi
此值(2014-06-14 16:20:10.000)是通过语法创建的,具有当前日期和时间,可能是在16-06-2014在4.20创建,如果你想要2014-06-14 09:00:00.000那么你将最后12位替换为09 :00:00.000或者你可以创建唯一的日期并在最后一天追加'09:00:00.000'。



我不知道为什么你使用日期和时间像这样,更好地根据系统日期和时间转换数据和时间,如16-06-2014 09.00或06-16-2014 09.00.i认为你使用默认的日期和时间格式





问候

Aravind
Hi This value(2014-06-14 16:20:10.000) is created by syntax with current date and time,may be it create on 16-06-2014 at 4.20,if u want 2014-06-14 09:00:00.000 then u replace last 12 digit to 09:00:00.000 or u can create only date and append '09:00:00.000' at last of date.

I am not know why u use date and time like this,better to convert data and time based on system date and time like 16-06-2014 09.00 or 06-16-2014 09.00.i think u use default date and time format


Regards
Aravind


这篇关于基于动态对象更改值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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