Access中的当前/系统日期 [英] Current/System date in Access

查看:355
本文介绍了Access中的当前/系统日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在使用SQL创建库db。


我有借书的日期(日期)借用)和日期返回

的书(返回日期),这是4周。


如何获得当前日期显示在借用的日期 - 字段?

我如何添加4周的借用日期,我可以在INSERT中进行

INTO句子吗?


谢谢,


Miikka

Hi All,

I''m making library db using SQL.

I have date when book has been loaned (Date loaned) and date to return the
book (Return date), which is 4 weeks.

How can I get current date to show in Date loaned-field?
How do I add 4 weeks to date loaned and can I do it in INSERT
INTO-sentence?

Thanks,

Miikka

推荐答案

设置Loaned文本框的默认值属性to = Date()


使用Loaned文本框的After Update事件过程提前28天设置

返回日期文本框:


Private Sub Loaded_AfterUpdate()

Me。[返回日期] = DateAdd(" d",28,Me.Loaned)

结束Sub


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Miikka Hamalainen" < MI *************** @ haminetti.net>在消息中写道

news:co ********** @ phys-news1.kolumbus.fi ...
Set the Default Value property of your Loaned text box to =Date()

Use the After Update event procedure of the Loaned text box to set the
Return date text box 28 days ahead:

Private Sub Loaded_AfterUpdate()
Me.[Return date] = DateAdd("d", 28, Me.Loaned)
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miikka Hamalainen" <mi***************@haminetti.net> wrote in message
news:co**********@phys-news1.kolumbus.fi...
大家好,

我正在使用SQL创建库数据库。

我有约会借书日期(借出日期)和日期返回
预订(返回日期),是4周。

如何在Date借用的字段中显示当前日期?
如何添加4周的日期借用,我可以在INSERT中进行
INTO判决?

谢谢,

Miikka
Hi All,

I''m making library db using SQL.

I have date when book has been loaned (Date loaned) and date to return the
book (Return date), which is 4 weeks.

How can I get current date to show in Date loaned-field?
How do I add 4 weeks to date loaned and can I do it in INSERT
INTO-sentence?

Thanks,

Miikka



我可以用SQL做这个吗? br />

" Allen Browne" <铝********* @ SeeSig.Invalid> kirjoitti

viestiss?:41 *********************** @ per-qv1-newsreader-01.iinet.net.au ...
Can I do this with SQL?

"Allen Browne" <Al*********@SeeSig.Invalid> kirjoitti
viestiss?:41***********************@per-qv1-newsreader-01.iinet.net.au...
将Loaned文本框的默认值属性设置为= Date()

使用Loaned文本框的After Update事件过程来设置
提前28天返回日期文本框:

Private Sub Loaded_AfterUpdate()
我。[返回日期] = DateAdd(" d",28,Me.Loaned)
End Sub

-
Allen Browne - 微软MVP。西澳大利亚州珀斯。
访问用户提示 - http://allenbrowne.com/ tips.html
回复群组,而不是mvps dot org的allenbrowne。

Miikka Hamalainen < MI *************** @ haminetti.net>在消息中写道
新闻:co ********** @ phys-news1.kolumbus.fi ...
Set the Default Value property of your Loaned text box to =Date()

Use the After Update event procedure of the Loaned text box to set the
Return date text box 28 days ahead:

Private Sub Loaded_AfterUpdate()
Me.[Return date] = DateAdd("d", 28, Me.Loaned)
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miikka Hamalainen" <mi***************@haminetti.net> wrote in message
news:co**********@phys-news1.kolumbus.fi...
大家好,

我正在使用SQL制作图书馆数据库。

我有约会借书日期(借出日期)和退还日期
书(返回日期),这是4周。

如何在Date借用的字段中显示当前日期?
如何添加4周的借阅日期,我可以在INSERT
INTO句子中进行吗?

谢谢,

Miikka
Hi All,

I''m making library db using SQL.

I have date when book has been loaned (Date loaned) and date to return
the book (Return date), which is 4 weeks.

How can I get current date to show in Date loaned-field?
How do I add 4 weeks to date loaned and can I do it in INSERT
INTO-sentence?

Thanks,

Miikka




没有。 AFAIK,您不能使用DDL SQL语句将Access表中字段的默认值设置为

a函数。


如果需要设置返回在许可

现有记录的贷款日期之后的28天,您可以使用更新查询。 (在查询设计视图中更新查询

菜单。)


-

Allen Browne - Microsoft MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Miikka Hamalainen" < MI *************** @ haminetti.net>在消息中写道

news:co ********** @ phys-news1.kolumbus.fi ...
No. AFAIK, you cannot set the Default Value of a field in an Access table to
a function with a DDL SQL statement.

If you need to set he Return Date to 28 days after the Loaned date for many
existing records at once, you could use an Update query. (Update on Query
menu in query design view.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miikka Hamalainen" <mi***************@haminetti.net> wrote in message
news:co**********@phys-news1.kolumbus.fi...
我可以用SQL做到这一点吗?

Allen Browne <铝********* @ SeeSig.Invalid> kirjoitti
viestissd:41 *********************** @ per-qv1-newsreader-01.iinet.net.au ...
Can I do this with SQL?

"Allen Browne" <Al*********@SeeSig.Invalid> kirjoitti
viestissd:41***********************@per-qv1-newsreader-01.iinet.net.au...
将Loaned文本框的默认值属性设置为= Date()

使用Loaned文本框的After Update事件过程设置
返回日期文本提前28天:

Private Sub Loaded_AfterUpdate()
我。[返回日期] = DateAdd(" d",28,Me.Loaned)
End Sub

" Miikka Hamalainen" < MI *************** @ haminetti.net>在消息中写道
新闻:co ********** @ phys-news1.kolumbus.fi ...
Set the Default Value property of your Loaned text box to =Date()

Use the After Update event procedure of the Loaned text box to set the
Return date text box 28 days ahead:

Private Sub Loaded_AfterUpdate()
Me.[Return date] = DateAdd("d", 28, Me.Loaned)
End Sub
"Miikka Hamalainen" <mi***************@haminetti.net> wrote in message
news:co**********@phys-news1.kolumbus.fi...
大家好,

我正在使用SQL制作图书馆数据库。

我有约会借书日期(借出日期)和退还日期
书(返回日期),这是4周。

如何在Date借用的字段中显示当前日期?
如何添加4周的借阅日期,我可以在INSERT
INTO句子中进行吗?

谢谢,

Miikka
Hi All,

I''m making library db using SQL.

I have date when book has been loaned (Date loaned) and date to return
the book (Return date), which is 4 weeks.

How can I get current date to show in Date loaned-field?
How do I add 4 weeks to date loaned and can I do it in INSERT
INTO-sentence?

Thanks,

Miikka



这篇关于Access中的当前/系统日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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