472,783 Members | 877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 software developers and data experts.

Date

Joe
In Excel you are able to write a formula
=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) which will return
todays date 1 year ago. I'm not sure if I am explaining this right so
bear with me. Is there a similar function in Access that I can you in
a text box? Thanks.
Nov 12 '05 #1
5 4476
Did you mean something like Date()-365
"Joe" <jo**@cogeco.ca> wrote in message
news:p5********************************@4ax.com...
In Excel you are able to write a formula
=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) which will return
todays date 1 year ago. I'm not sure if I am explaining this right so
bear with me. Is there a similar function in Access that I can you in
a text box? Thanks.

Nov 12 '05 #2
Joe
On Wed, 03 Sep 2003 01:24:49 GMT, "Omey Samaroo"
<no****@replytogroup.com> wrote:
Did you mean something like Date()-365
"Joe" <jo**@cogeco.ca> wrote in message
news:p5********************************@4ax.com.. .
In Excel you are able to write a formula
=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) which will return
todays date 1 year ago. I'm not sure if I am explaining this right so
bear with me. Is there a similar function in Access that I can you in
a text box? Thanks.

Thanks, didn't realize it was so easy. The next question could be a
bit harder. How do I make it default to Jan 1 of the current year?

Nov 12 '05 #3
=DateAdd("yyyy",-1,Date())

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Joe" <jo**@cogeco.ca> wrote in message
news:p5********************************@4ax.com...
In Excel you are able to write a formula
=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) which will return
todays date 1 year ago. I'm not sure if I am explaining this right so
bear with me. Is there a similar function in Access that I can you in
a text box? Thanks.

Nov 12 '05 #4
On Wed, 03 Sep 2003 02:24:06 GMT in comp.databases.ms-access, "Tim
Mills-Groninger" <ti***@earthlink.net> wrote:
dateserial(year(date())-1,month(date()),day(date()))

Microsoft is a bit like the former Soviet Union when it comes to consistancy
between applications. Excel's Today function maps to Access's Date(),
Excel's date becomes Access's DateSerial. And don't even get me started on
string functions. sigh.


How about string theory then? Access supports eleven dimentional
arrays <g>

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)
Nov 12 '05 #5
On Wed, 03 Sep 2003 18:51:24 +0100 in comp.databases.ms-access, Trevor
Best <bouncer@localhost> wrote:
or use DateDiff()


or even DateAdd().. d'oh! :-)

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
9
by: Thomas R. Hummel | last post by:
Hello, I am importing data that lists rates for particular coverages for a particular period of time. Unfortunately, the data source isn't very clean. I've come up with some rules that I think...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
3
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location,...
1
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
3
by: JJ | last post by:
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.