合并日期/时间字段 [英] Combine Date/Time fields

查看:101
本文介绍了合并日期/时间字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个表格,在不同的字段中列出日期和相应的时间。为了构建查询以计算经过时间,我想将[短日期格式]字段与[长时格式]字段组合,最后以新字段[一般日期格式]结束......是否可能?

I am working with a table that lists dates and corresponding times in separate fields. For purposes of building a query to calculate elapsed time I would like to combine a [Short Date format] field with a [Long Time format] field ending up with a new field [General Date format]... Is it Possible?

推荐答案

你想看一下CDate函数。
You''ll want to take a look at the CDate function.


我不确定你是否需要使用CDate()兔子。 Access如何处理这些日期的事情是如此古怪,但只是做了

YourNewField = YourShortDate& " " &安培; YourLongTime

看起来很好。然后,您可以在DateAdd和DateDiff等日期功能中使用结果,没有问题。


欢迎来到TheScripts,新海报!


Linq ; 0)>
I''m not sure you need to use CDate() Rabbit. How Access handles these date things is so quirky, but simply doing

YourNewField = YourShortDate & " " & YourLongTime

seems towork just fine. You can then use the results in Date oriented functions, such as DateAdd and DateDiff, without problems.

Welcome to TheScripts, New Poster!

Linq ;0)>


Thanx Rabbit和Linq。它运作得很好。 dateDiff是锦上添花!
Thanx Rabbit and Linq. It worked great. dateDiff was the icing on the cake!


这篇关于合并日期/时间字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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