复制一行行,获取一个值:日期.必须是System.DateTime.now [英] Copy a row exept, for one value: the date. which have to be the System.DateTime.now

查看:74
本文介绍了复制一行行,获取一个值:日期.必须是System.DateTime.now的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一个表的行复制到另一个表,除了一个值:logdate

未从任何行中选择logdate值,它必须是NOW日期和时间.

我不知道使它工作的语法?

这是我的SQL:

插入日志文件表(文件名,文件类型,文件列,FK更新,父纤维FK,日志日期)logdate = Systen.DateTime.Now
SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK FROM filetable,其中filename ="sorteringstest",parentfiberFK = 6,文件类型<> ''.pdf''

i need to Copy a row exept from one table to another, except for one value: logdate

The logdate value is not selected from any row, it has to be the NOW date and time.

i dont know the syntax to make it work?

this is my sql:

INSERT logfiletable(filename,filetype,filecolomn,lastupdatebyFK,parentfiberFK,logdate)logdate=Systen.DateTime.Now
SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK FROM filetable where filename =''sorteringstest'' and parentfiberFK= 6 and filetype <> ''.pdf''

推荐答案

您不能在SQL中使用System.DateTime.Now.您必须改用SQL函数getdate.
You can''t use System.DateTime.Now in SQL. You would have to use the SQL function getdate instead.


类似以下内容:

Something like this:

INSERT INTO logfiletable(filename,filetype,filecolomn,lastupdatebyFK,parentfiberFK,logdate)
 SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK, GetDate() FROM filetable where filename =''sorteringstest'' and parentfiberFK= 6 and filetype <> ''.pdf'' 


这篇关于复制一行行,获取一个值:日期.必须是System.DateTime.now的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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