473,499 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access - Need Help Calculating in a Table

1 New Member
Ive Created a Access Data Base, and on my main table I have a field titled "Date Entered", which has the lists the date the record was created (through date() formula). What I want to do is have another field in that table that caculates the difference in days from the "date entered" column to the current date. I was using the formula:

datediff("dd", [date entered], date())

I am receiving the the error of "does not recognize the field "date entered", I think I have all the same format for the dates, but am really stumped by this one, so if anybody can give any suggestions to get this caculation, please let me know, this is my first database.
Oct 20 '08 #1
1 1465
Stewart Ross
2,545 Recognized Expert Moderator Specialist
When you say 'table', is that what you really mean? You cannot place such a calculated field in the underlying table. It has to be placed in a query based on that table. The form of the SQL is similar to:

Expand|Select|Wrap|Line Numbers
  1. SELECT <other fields>, datediff("dd", [date entered], Date()) as DaysDiff
  2. FROM yourtable;
If this is indeed what you are doing then you must check that the field's name is indeed 'Date Entered'. If it is, then to rule out any further problem with the DateDiff function itself you can simply subtract the dates directly to obtain the difference in days:

Expand|Select|Wrap|Line Numbers
  1. SELECT <other fields>, Date() - [date entered] as DaysDiff
  2. FROM yourtable;
-Stewart
Oct 20 '08 #2

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

Similar topics

1
2279
by: Heath | last post by:
I have serious Access problems so please be gentle. I have one table that stores the quantities and net sales for thousands of Products. I have another table that has fixed costs values on a...
6
2712
by: Michael Bulatovich | last post by:
I have a very simple db I use for keeping track of hours, tasks, projects, clients etc. It has a form that I use to enter data. Currently the form has a textbox for a field called "start time",...
3
2162
by: Iain Miller | last post by:
Can anybody help me with some Access 2000 code? I don't do a lot of coding in Access & so every time I come back to do something I pretty much have to relearn the syntax from scratch so this is...
2
2495
by: kuhni | last post by:
Hi everybody! After searching newsgroups for a couple of hours, I now try asking directly (running the risk of asking again the same question). My problem is to predict when the size of the...
10
47708
by: tkq | last post by:
I have a normal table with customer information I have a DoB field and I want to have an automatic calculation that will show the age of the customer in another field next to it called Age ...
5
2897
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a...
9
15747
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, Can anybody please help me, how to access all rows in a grid view if the paging is enabled? If gridview contains 100 rows and pagecount=10, then in the gridview.rows collection, i'm...
10
15945
by: Nightspeace | last post by:
Hello Everyone, I am currently trying to create a 3 month running wieghted average to forecast the comming months. My Table consits of 3 colums (Table ID), (Date),(Monthly Total). (Table...
2
1397
by: Lumpy | last post by:
This question isn't relating to some specific piece of code, but more along the lines of the logic or best method I should use with access 2003 and VBA. I am new to access programming and I am...
3
1591
by: perfectclick.ng | last post by:
I'm a beginner of MS Access, I need adequate knowledge on how to programme. I have a challenge in my office to write a pragramme that will calculate a compensation for all our distributors. This is...
0
7130
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
7007
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
7220
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
5468
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,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.