Count How Many Lines Stored In A Field.
Jun 26, 2007Is there any way to count how many lines of text are stored in a particular table field? How about counting how many times was the "enter" key pressed?
Thanks
Mafhobb
Is there any way to count how many lines of text are stored in a particular table field? How about counting how many times was the "enter" key pressed?
Thanks
Mafhobb
Hi there,
LEts say I have a table
branch item $COGS
we have lots of same items having different $COGS in different branches and all of them are on one table
I sorted that descending by $COGS.
Now I want to pick for each item only 4 first lines having bigger $COGS.
The rest of the lines should be deleted.
How I can do that?
Thanks
In a query, how do I do a count of the number of lines that appear in the query? Not the number of records, because the query itself is grouped. The results are in order, highest to lowest, and I want to see just the top 50.
View 3 Replies View RelatedI have a memo field that feeds to a textbox control on one of my forms. I would like to re-format the textbox using the .Height value based on how many lines appear in it (i.e. it will fit only 3 lines if there are 3, but 5 lines if there are 5, etc.).
Is there any way to count the number of lines that appear in the textbox?
I am using a predefined query to define the sql statement that will serve as recordsource to a form. Syntax is fine. The predefined query does not have the primary key of the table. The selection in the recordsource is done using this key. So I add this field to the design of the query. I save the query. It says the query is saved. But it is never saved. Run the query again it is not changed.
View 5 Replies View RelatedI've exported some data which has 3-4 address line within the same field which is very odd.
The row has all the usual data, but when I look at the data in datasheet view the adresss line 1 shows only but when I click into the field and press down, more address info comes up. Is there any way to have this on one row within the field rather than multiple.
A bit like in Excel when you Alt+Tab in a cell it drops down but is the same cell, well this exactly like that in Access 2003.
I'm using a query to concatenate data from a table into a specific HTML format. I would like, however, to find a way to remove lines of HTML when there is no data in a specific field.
Example:
If I were to create a list of available colors of a shirt like so:
<ul>
<li>[Color1]</li>
<li>[Color2]</li>
<li>[Color3]</li>
<li>[Color4]</li>
</ul>
but if there were only 3 available colors, I'd end up with this:
<ul>
<li>[Color1]</li>
<li>[Color2]</li>
<li>[Color3]</li>
<li></li>
</ul>
I need to find a way to get rid of that last vacant tag. I image there's some kind of code I could write (if x is null, clear line17, or something like that) but I wouldn't even know where to start with that.
I have a table with a list of different government programs that products can take advantage of. Each of these programs has criteria such as "must use less than 1000W" or "lasts for 100 hours". Rather than have a column for each possible condition, I've created 3 fields that will accept any type of condition; Var1Condition (example: watts) , Var1Requirement (example: >=), and Var1Value (example: 50). I figured this would be the more efficient database design than to add 15-20 columns.
I then built a form that would where I could enter product attributes and would hopefully query my database and only return the programs for which the product would qualify. So I would have a field named "Watts" in which I would put the wattage of the product and then I would see which programs it would fall in.
In theory, it should be simple. I figured I could just find a way to combine my 3 criteria fields into one string "Forms!Search!watts >= 50" and then use that as a query filter, but I can't find a way to do it.
I have a query that displays the difference between the number of scanned and processed invoices for each date (invoices scanned minus processed). Now I would like to make a query that for each date based on this shows the total backlog accumulated.
Example table:
The first column contains the date, and the second number of invoices scanned minus invoices processed.
2014-01-02 53
2014-01-03 -15
2014-01-04 24
Would it be possible somehow to make a query that for each lines shows the complete sum of all previous lines?
Based on the above data the result should be:
2014-01-02 53
2014-01-03 38
2014-01-04 62
Or would I have to write some VBA code to create some kind of temp table?
Ive had a recurring problem with one of my databases
ive got a form with a subtable on it, the subtable is very important as much of the DB's data is entered in there.
every once and a while one of the users will be doing data entry and on a certain field (a short text field if that makes any difference) theyll push enter instead of tab, to move on to the next field, enter creates a new line instead of moving to the next field, when a new line is created the user will either assume the field is blank and retype the data or ignore it entirely and move on
the trouble is one of my queries completely fails to work when there are multiple lines in this field (comes with a data type mismatch error)
is there a way to prevent the field from being able to contain multiple lines (like a property setting or some VB code?)
I have a memo field which records the events that happen on a form. So for example when a user changes the assignment from one user to the next, a row is written to the memo field indicating date, time, windows logon and then a brief description
Basically I end up with :
07/12/06 11:16:34 kleaves : Assigned user changed from Joe Bloggs to John Doe
At present every new row is added to the memo field at the end, so the most recent action is at the bottom.
How can I sort this so that most recent is at the top.
With microsofts article, I have made to store multi options value of a list box in a text box with comma. However, since these are IDs being stored, I want these values to run a query and get results also.
But I am confused since have never used comma like in query
I have several projects with different tasks for each. I have 3 fields [fkProjectsID], [TaskOrder] and [Duration] in a table for project tracking with that structure:
[fkProjectsID] [TaskOrder] [Duration]
1 /1 /5
1 /2 /8
1 /3 /15
1 /4 /6
2 /1 /8
2 /2 /30
2 /3 /25
I want to calculate cumulative values stored in [Duration] field (represent a number of days). I'm using the field [TaskOrder] to order different tasks within each project. With some testing, I was able to calculate cumulative [Duration] with 1 project using the DSum fucntion as following:
CumulDuration: DSum("[Duration]", "[tblProjectTracking]", "[TaskOrder]<=" & [TaskOrder])
I was having the sequence: 5, 13, 28, 34 for respectively Task 1,2,3,4. However, when I add a second project (and then a third...), I need to be able to filter based on [fkProjectsID] as well (i.e. a specific DSum by ProjectsID). I add this criteria but I get the sum of [Duration] on each row instead of the cumulative:
CumulDuration: DSum("[Duration]","[tblProjectTracking]","[TaskOrder]<=" & [TaskOrder] And "[fkProjectsID]=" & [fkProjectsID])
I have a question regarding the display of a list of numbers that are stored into a field of my database. Currently the numbers are comma-delineated which is fine with me, but I was wondering if there is a way to change the display of those numbers on the form so that it is easier to read.
Example:
current format - 1,2,3,4,7,8,9,10
desired format - 1-4, 7-10
I have a table tblBookings.
In this table it has a bookingID, CustomerID and some other none relevant details.
The CustomerID comes from table tblCustomer. i.e a customerID must exist in the customer table to be allowed in the bookings table tblBookings
A customer can exist in tblCustomer without existing in the booking table.
I am trying to write a query that will list each and every customer ID in the tblCustomer and count the number of bookings that that customer has (even if it is zero).
I have a query that will count the bookings if they exist in the booking table and display the number of times that a customer appears in the bookings table.
SELECT tblBookings.CustomerID, Count(tblBookings.CustomerID) AS NoOfBookings
FROM tblBookings
GROUP BY tblBookings.CustomerID;
How do I create a query that will do this but list all customers even if they don't exist in the bookings table (but obviously occur in the customers table)
I am trying to create a similar query where all bookings per hotel are listed even if no bookings are made for that hotel. I am guessing the answer is the same as above.
The Ritz. Bookings 0
The Hilton. Bookings 3
The Carlton. Bookings 0
The Lowry. Bookings 2
For every hotel.
That kind of thing.
If you need more information please shout.
I have a database of purchase orders
Many of the purchase orders have a revision No against them, eg:-
Purchase Order No / Line No / Revision No / Value
1001 / 001 / 00 / £50
1001 / 001 / 01 / £100
1001 / 001 / 02 / £200
I am trying to find a way to write a query that will show me the actual value of the final revised value of each Purchase order line ie: the answer to above is
1001 / 001 / 02 / £200
Could anyone please help?
Why is this update query not working, I'm trying to update a date field stored in a table.
The new date is passed from a txtbox on a form to the update query!!!
SQL code
UPDATE TblDietPlantemp SET TblDietPlantemp.MealDate = [Forms]![FrmSwitchBoard]![txtCusDate];
I have a single table with customer information, one of the fields is a date field "LastContacted".
I'm creating a search form with 2 date fields (txtDate1 & txtDate2) to search a date range of the LastContacted field, and I need to write this into the query that the search form uses.
I have written this using Nz so that it can still return results if the search boxes are left blank:
Between Nz([Forms]![frm_AdvancedSearch]![txtDate1],#01/01/1989#) And Nz([Forms]![frm_AdvancedSearch]![txtDate2],#01/01/2999#)
This seems to work and it returns lines from the table where there is a date entered. However some of the fields in the table have no entry in the LastContacted field. How to code this query so that it also returns lines where the LastContacted field is blank in the table?
I have tried:
like "*" & (Between Nz([Forms]![frm_AdvancedSearch]![txtDate1],#01/01/1989#) And Nz([Forms]![frm_AdvancedSearch]![txtDate2],#01/01/2999#)) & "*"
but this returns errors when I try to run it.
I'm using Access 2010.
I have developed a database but have had difficulty with sorting data within subform of a main form. The subform displays the related tasks that correspond with main form that has been selected. Within the main form I have also created a text field that defines a particular sorting sequence of the tasks found within the subform which is titled Task Sequence. What I would like to do, is use the Task Sequence field to sort the order of tasks within subform. I have tried: IIf([ID] Is Null, 0, Val([Task Sequence])) within the Advanced filter/sort but either it shows only the first task defined in the Task Sequence or it wants to filter the main form and not the subform.
View 14 Replies View RelatedI have a parent form that has the following
[Category],[Event],[Name]
In the sub form i am also storing the same values
[Category],[Event],[Name] & [Contestant ID], [Score1],[Score2]
I do not want to enter the
[Category],[Event],[Name] each time i enter a record into this sub form i would like the value that is in the parent form to be picked up and stored as the values for these fields.
Is there a simple way of doing this?
I have a main data table and my users will input their information on a main form. One of the fields is called "IsSkyBlue", which is a Yes/No checkbox field. On the form (which has multiple tabs), it asks the question "Is the Sky blue", with instructions to check the box if the answer is "Yes". I have a "Summary" tab, and on it I want to provide the user's answer in written form. I want it to say: Do you think the sky is blue? YES
So, I have a text box on the Summary tab with the question, and for the answer, I tried =IIf([IsSkyBlue]=YES,"Yes","No"), but I get a #NAME? error in that field. I have tried using YES, TRUE, 1, 0, -1, Not Null.... nothing works in the IIf statement.
Does anyone know how Access stores a "YES" answer to a YES/No field?
I'm currently working with a form, which is in datasheet view. I have many rows which are combo boxes (yes/no), and the name is rather long. So each line (each row) spreads on to 2-3 pages to the right.What I would like to do is make the namebar, on top of every column, a little bit higher, so the name would be split into two lines, or three. Allowing me to make the width allot smaller.Here is an example of my problem:http://213.213.137.96/~terminal/columns.jpgSo my question is, can I change the height of the column name? Or is there some trick I can use?regardsFrímann Kjerúlf
View 1 Replies View RelatedHello All!
I'd really appreciate some help for what I fear is actually a very amature question...any assitance would be greatly appreciated!
I have the following table:
SubCount---------HomeDetailsID------FoodDetailsIDFK--PrimaryName
Ruteete--------------199------------------54-----------Amatehe
Ruteete--------------218------------------54-----------Amatehe
Ruteete--------------199------------------54-----------Amatehe
Ruteete--------------198------------------90------------Amoozi
Ruteete--------------204------------------90-------------Amoozi
Ruteete--------------192------------------20----------Banana Juice
By Subcounty, it shows what homes in the subcounty are consuming a particular food item. What I would like to do is count the number of times that food item is being consumed in each subcounty and generate a new table to compile this data.
And I am trying to use the count function to return the frequency of each Food being consumed. However, the count function counts all the records and returns a value of 6. What I would like is it to count the frequency of each food and ultimately build the following table:
SubCounty---NumHomesFreqBasedOn--FoodDetailsIDFk-PrimaryName---Freq
Ruteete----------------6------------------54-----------Amatehe------3
Ruteete----------------6------------------90------------Amoozi-------2
Ruteete----------------6------------------205--------Banana Juice----1
I was thinking that this may involve using a loop to get a count on each specific food but the logistics of doing this are beyond me at the moment. Does anyone have any suggestions?
Thanks!
How can I add a field that just populates "1" for each record so I can do a count. I know I can count based on a specific field but my boss wants to see a field that just shows "1" so I can SUM it up in another query.
View 9 Replies View RelatedI have a dataset with "Date", "Product ID", and "Revenue" fields. I'd like to create a query that rolls the data up at the daily level and reports "Count of Product ID" (unique product IDs) and "Sum of Revenue". I'm having trouble figuring out the logic.
View 1 Replies View RelatedI have attempted to create a chart in Access and it does work to a degree, but I get the strange sample chart in design view and can see charting the data in my database to be troublesome.
I've had a "brainwave".
I'd like the user to have a command button to bring up a form screen or a report screen and for it to have some data in it.
I have a field 'Reason' and it's text box is actually a combo box containing around 9 different values.
I'd like my form/report to list these values then next to it tells the user how many are displayed.
Below is just three things that is in the 'Reason' combo box. I have around 9 different ones in total.Notice on the right I have example numbers. Is there a way to do calculate this?
Thanks.
CFT: 45
RTA: 56
Obstruction:509