By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,747 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,747 IT Pros & Developers. It's quick & easy.

A97: Get the month, day, and year from a date field in a table

P: n/a
pw
Hi,

I'd like to check if the month, day, and year of a date field in a
table equals certain values (in a DCount() function) in Access 97.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenterprises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Can't you just put this field in a query ...

MyTest: (Month([OrderDate]) = DCount("*","tblTest","[OrderID]=" & [OrderID]))

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"pw" <pw@removewilliamsonenterprises.com> wrote in message news:5r********************************@4ax.com...
Hi,

I'd like to check if the month, day, and year of a date field in a
table equals certain values (in a DCount() function) in Access 97.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenterprises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Nov 12 '05 #2

P: n/a
pw
>Can't you just put this field in a query ...

MyTest: (Month([OrderDate]) = DCount("*","tblTest","[OrderID]=" & [OrderID]))


Thanks Danny.

-pw
please use "pw at williamsonenterprises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #3

P: n/a
Hello,

After creating an arbitrary table with these dates:

table name: tblBlah
field: anydate
values:
12/15/2003
11/12/2003
11/23/2003
12/25/2003
1/1/2004
I then ran this code…
Dim x, y, z As Integer

x = DCount("tblBlah.anydate", "tblBlah", "Year(tblBlah.anydate) = 2003")
y = DCount("tblBlah.anydate", "tblBlah", "Month(tblBlah.anydate) = 12")
z = DCount("tblBlah.anydate", "tblBlah", "Day(tblBlah.anydate) = 25")

MsgBox x & ", " & y & ", " & z
And got this display in the message box: 4, 2, 1
(for x, y & z, respectively)

-Paul T.

pw <pw@removewilliamsonenterprises.com> wrote in message news:<5r********************************@4ax.com>. ..
Hi,

I'd like to check if the month, day, and year of a date field in a
table equals certain values (in a DCount() function) in Access 97.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenterprises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.