473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Basic Date Function, Need Help

Hi guys, this is gonna sound very simple but got a slight problem with the critera of one of my database's.


Basically i am looking to have a criteria in a Query that returns all the database fields that are 7 days old or less. Before i was using ">Date()-7" but since it turned September it's no longer working at it wont show any of the September database entries only the August ones that are still within the 7 day gap, ie. 29th, 30th and 31st August but nothing from September.

Anyone got any ideas how to fix this?

Thanks
Sep 4 '06 #1
9 2235
PEB
1,418 Expert 1GB
You can try:

> int(Now()) - 7

:)
Sep 4 '06 #2
PEB
1,418 Expert 1GB
Or

>Cvdate(Date())-7

or

>Cvdate(str(Date()))-7

Hope that it will work!
Sep 4 '06 #3
Tried both and they didn't work, i looked at it in more depth in my database and basically it turns out the Database i have has been adding the automatic dates for September in a different manner than August.

Before it was adding the dates in the format dd/mm/year, now its adding the dates in the format for mm/dd/year.

i use the Date$() for the default value in my date field so it automatically adds the date when i add a new record via my Access Page, is there anyway to change access so that it adds the new dates in the UK format instead of the US format?
Sep 4 '06 #4
PEB
1,418 Expert 1GB
Yes, it can be a reason for this!

But is your Date stored as a Date field or in a text field?

It seems that your date is stored in a text field! This explains why the previous functions doesn't work!

So to store your Date in a convenient Format
do the follow:

Format(Now(),"dd/mm/yyyy") when you put your date stamp

:)
Sep 4 '06 #5
Fantiastic that did the trick, thanks a ton PEB :D

Oh by the way i was wondering if maybe you have a suggestion about this other problem i have.

Like i said before i use a Data Access page to add new infomration to my database, its very simple its for adding and recording phone messages. The page itself is a database view it lists all records, took a screen dump so you could see what i mean:

Click Here

My problem is everytime i add a new record it does it from the bottom and it means anyone that access's the page has to scroll alll the way to the bottom, which is just annoying more than anything else to be honest.

I was wondering if there is any way to change this so it adds new records from the Top of the page, or maybe possible to have 2 sections one for new data input and another for listing all the old messages?

Any help you can provide would be brilliant!!

Thanks :D
Sep 4 '06 #6
PEB
1,418 Expert 1GB
If you have an id of the calls, the latest calls will be with the biggest numbers!

If you can sort descending the column of id maybe You will have the new messages on the top!
;)
Sep 4 '06 #7
Yeah tried that before just put the the criteria for the ID on the query in decending order and it lists all the records from newest at the top to oldest at the bottom.

Problem is when it does this and i try adding new record, it adds the new empty feilds at the very very bottom of the datalist so the user has to scroll alll the way to the bottom of the page to fill in the blank fields.

Click Here

Any way to make it put up the new blank fileds for entry at the top of the Page? i know you can do something similar in a Form like have the Header section have a kinda data entry area then have the Footer contain a repeating list of all the data in the query, but in the Data Access Page it only lets you have one area with Bound fields so cant do that :(
Sep 4 '06 #8
PEB
1,418 Expert 1GB
Ok!

It's true that I've never worked with data access pages but if you canmodify the page property Data entry when clicking on addNew???

Or if it's immpossible on Addnew you can open a page designed only for data entry and not to show an information???

Have a nice luck!
Sep 4 '06 #9
Could easily create a new page for Data entry only yeah but id love something that does both lol.

I aint no expert on access pages myself to be honest, just a basic understanding so struggling with them too :( If there is a way to modify the addNew function so that it adds the new blank entry fields at the top of the page instead of the bottom that would be perfect.
Problem is i have no idea to do it lol, i used the function wizard to create the add new record button on my page so any idea on how i could modify it to add new records would be awesome. :)
Sep 4 '06 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Riley | last post by:
The date fields being saved by a VB program were being saved as #2003-11-22#. For reasons unknown to me these dates began to be saved as "11/22/2003" All of these dates were made dates with the...
6
by: Igorati | last post by:
I need some ideas of how to accomplish this task. I was told that I just need to save the input in a file and make the file searchable, nothing fancy like tying into SQL or Oracle. THis is a basic...
8
by: Cherrish Vaidiyan | last post by:
hello googles, I have a small sqlplus problem. i have created a table with date field along with other varchar2,number etc. But unfortunately i made a mistake in entering the date. for some date...
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...
5
by: Bob Alston | last post by:
I am looking for any Microsoft Access based software that could be used for a United Way agency that provides basic needs assistance - food, clothing, financial (rent, utilities, Rx, gasoline,...
3
by: boss0021 | last post by:
Does anyone know how to: Populate a ComboBox with all the days of the year for 2005 with out doing it manually
36
by: MLH | last post by:
Does Date = Date + 1 mean Date Statement equals Date Function plus 1? And if the answer is Yes, how much actual time is being added to the date function in this assignment?
8
by: John Wildes | last post by:
Hello all I'm going to try and be brief with my question, please tell me if I have the wrong group. We are querying transaction data from a DB3 database application. The dates are stored as...
8
by: saladinator | last post by:
I have created an Excel spreadsheet that has a lot of data. What I want to do is import the spreedsheet to Access and create a form so that I can print each row per page in a proffessional manner....
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.