473,792 Members | 3,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Basic help (i think)

Hi!

I'm building a db in access for a school project, and was wondering how to
make the value for a field the same as the number of records with the same
value in another field.
e.g.
DvdTitle = Pulp fiction
StockLev = 1

DvdTitle = Finding Nemo
StockLev = 2

DvdTitle = Finding Nemo
StockLev = 2
etc.

also (you can tell how little I've used access now...) how to say a currency
value(the price of each dvd)*a numeric value (the stock level) in the field
StockCost. I presume it is just "=Price*StockLe v" in default value field.

Thankyou very much (in advance)
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003
Nov 12 '05 #1
3 1780
If table1 is the name of your table...

This a MAKE-TABLE Query

SELECT DISTINCTROW Table1.DvdTitle , Table1.StockLev , Count(*) AS [Count Of
Table1] INTO Table2
FROM Table1
GROUP BY Table1.DvdTitle , Table1.StockLev ;

Then This query will populate the count field

UPDATE DISTINCTROW Table1 INNER JOIN Table2 ON Table1.DvdTitle =
Table2.DvdTitle SET Table1.StockLev = [Table2]![Count Of Table1];
About the Calculation...y our evaluation is correct but it is not good
practice to stor calculations. Calculations can be displayed in form,
reports and queries as you have described. Use the Builder option in the
Query tool to properly build the formula.
Nov 12 '05 #2
> If table1 is the name of your table...

This a MAKE-TABLE Query

SELECT DISTINCTROW Table1.DvdTitle , Table1.StockLev , Count(*) AS [Count Of
Table1] INTO Table2
FROM Table1
GROUP BY Table1.DvdTitle , Table1.StockLev ;

Then This query will populate the count field

UPDATE DISTINCTROW Table1 INNER JOIN Table2 ON Table1.DvdTitle =
Table2.DvdTitle SET Table1.StockLev = [Table2]![Count Of Table1];
About the Calculation...y our evaluation is correct but it is not good
practice to stor calculations. Calculations can be displayed in form,
reports and queries as you have described. Use the Builder option in the
Query tool to properly build the formula.


Thankyou! It turns out that I need many tables (i thought through the
assignment and found it was a crap specification). What i was trying to do
wasn't with queries, buti see now that that is the only way to add the full
functionality that was required. (teacher wanted a one table database with
customers, dvds, allsorts on the same thing - how stupid?)
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003
Nov 12 '05 #3
TC

I suggest you read:

http://support.microsoft.com/support...es/Q100139.ASP

HTH,
TC

steveee <sm************ *************** ***@ve.com.inva lid> wrote in message
news:Th******** **********@news fep4-glfd.server.ntl i.net...
Hi!

I'm building a db in access for a school project, and was wondering how to
make the value for a field the same as the number of records with the same
value in another field.
e.g.
DvdTitle = Pulp fiction
StockLev = 1

DvdTitle = Finding Nemo
StockLev = 2

DvdTitle = Finding Nemo
StockLev = 2
etc.

also (you can tell how little I've used access now...) how to say a currency value(the price of each dvd)*a numeric value (the stock level) in the field StockCost. I presume it is just "=Price*StockLe v" in default value field.

Thankyou very much (in advance)
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003

Nov 12 '05 #4

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

Similar topics

19
3225
by: Leif K-Brooks | last post by:
Has anyone ever tried implementing a simple unstructured BASIC dialect in Python? I'm getting interested in language implementation, and looking at a reasonably simple example like that could be pretty interesting.
7
9290
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. # No warranty express or implied for the accuracy, fitness to purpose
54
3986
by: seberino | last post by:
Many people I know ask why Python does slicing the way it does..... Can anyone /please/ give me a good defense/justification??? I'm referring to why mystring gives me elements 0, 1, 2 and 3 but *NOT* mystring (5th element). Many people don't like idea that 5th element is not invited. (BTW, yes I'm aware of the explanation where slicing
56
4139
by: Dave Vandervies | last post by:
I just fixed a bug that some of the correctness pedants around here may find useful as ammunition. The problem was that some code would, very occasionally, die with a segmentation violation error. (Not as infrequent as some bugs that have been discussed here in the past, but maybe once in an overnight run of the program when it was configured to aggressively exercise the section that the bug was in.) It was easy enough to trap the...
14
2515
by: luis | last post by:
Are basic types (int, long, ...) objetcs or not? I read that in C# all are objects including basic types, derived from Object class. Then in msdn documentation says that boxing converts basic types in objects. But if they are objects why it´s need this conversion? Aren´t objects (basic types) like Java?
4
4839
by: Dave | last post by:
Hi, Is there anyway to mimic forms authentication's loginUrl and RedirectFromLoginPage functionality using Windows authentication? We are developing intranet sites using basic authentication and we want to always redirect a user to a default 'splash' or welcome page that is set to anonymous if they are not logged in. This page would have
13
15569
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the HTTP level but as yet no fully useful answer. I too have been trying to call an apache/axis webservice which desires a username/password from my C# Client. (ie the equivalent of _call.setUsername("Myname") name from within a Java client proxy)...
4
2163
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a problem. Can they not just post the fix. I see no reason to contact MS since I have most likely sent about 1500 dumps to them and I would think this would get their attention.
97
5549
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in the first place. Anyone else heard about this development? The Master
14
1852
by: MartinRinehart | last post by:
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems logical to have them all inherit from a base class that defines those, but this doesn't work: import tok class code: def __init__( self, start, stop ):
0
9670
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2917
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.