I'm doing a project in iPhone where i'm using sqlite database. I have a text view where user can enter any text to create a note, and a text field where user can enter the name of that note. In database I've created two column 1st is note and 2nd is noteName, where noteName is the primary key. Now i want, if any user forget to enter the name of the note, then it will create a default name such as untitled name with a index which will increment automatically after every note creation.
Can anyone tell me how can I do that?
You can directly -- count the number of rows present in your table by a simple SELECT query.
And Append that "Count+1" number to noteName and insert that row in your database.
Related
I have 3 tables in 3 sheets. The email column is where the data is identified. Which means the emails will be unique in the expected results sheet after joining
To make a copy of the sheet click here
To view the sheet click here
First Sheet
First Name
Last Name
Email
Phone
Childs First Name
Child Last Name
DOB
Photo Permission
Allergies
Additional Info
Additional Contact
Teacher Name(s)
Sibling First Name
Sibling Last Name
DOB2
Allergies 2
Additional Info 2
Photo Permission 2
How did hear?
Second
Second-First Name
Second-Last Name
Second-Phone
Email
Second-Message
Third
Third-First Name
Third-Last Name
Email
I have tried with
=FILTER({First!A2:B,
VLOOKUP(First!C2:C, {Second!A2:A, Second!B2:D}, {2,3,4}, false)},
First!C2:C<>"")
But I need to ensure all 3 sheets are joined and the expected result look like
Expected
First
Second
Third
There are three formulas in cyan on the tab called MK.Help in this editable copy of your sheet:
This is the one for the second set of names:
=ARRAYFORMULA({Second!A1:E1;ARRAY_CONSTRAIN(IFERROR(VLOOKUP(C2:C,{Second!D:D,Second!A:E},{2,3,4,5,6},0)),COUNTA(C2:C),5);FILTER(Second!A2:E,Second!D2:D<>"",ISNA(MATCH(Second!D2:D,C2:C,0)))})
That do what you're hoping?
I have a google sheet with all current staff information. I have a second sheet for when some piece of data needs changed. Last name, Location, job ect.
on second sheet I am looking to have someone:
Enter the user's first name in column B,
and or Last name in Column C,
I would like a drop down box generated in column D from the given info to contain all usernames found in the sheet with current information for all staff that have the given first and or last names provided.
Once a username has been selected, I can get all the pertinent data from that user with a vlookup from the sheet containing all staff info. For example if someone typed Scott in column B, I would like a drop down generated in column D with all staff that have a first name of Scott. Likewise if the last name was supplied and of course if both first and last was supplied.
Validation need to be done that's it,
1) Go to Staff Changes'!B2 and Data Validation> List from range & choose range from 'Staff Info'!B2:B
2) Select cell'Staff Changes'!D2 and Data Validation> List from range & range will be filter formula i.e 'Staffing Changes'N2:N.
Result
Few tweaks in vlookup:
I am not sure if you need username column twice if you don't need then change your vlookup formula from =vlookup(D2,'Staff Info'!A:K,10,0) to =VLOOKUP(D2,'Staff Info'!$G$1:$K,2,0)
Please provide access to trix in future so that changes & result can be shown in it.
UPDATE:
Use data validation as before & hide filter colum or use seperate sheet for filter formula & use query function in cell A3 =QUERY('Staff Info'!A:J,"select ' ',A,F,' ',' ',G,' ',I,' 'where A='"&A2&"' AND F = '"&B2&"' LABEL ' ''Date',' ''Current Last Name',' ''New Last Name',' ''New Building',' ''New Classification'",1) result wil be something like this
QUERY
I've tried looking for an answer to this online for a few hours now, but I just can't work out how you'd describe it, or find an appropriate answer.
I have a spreadsheet where I'm wanting to pull out an ID in Column A into a separate tab, but only if it contains a certain phrase that's contained in Column E. In this separate tab, I then don't want there to be any gaps in between the IF statements.
So for example I want the next tab to pull through the Action ID if column E contains 'Client'. If it doesn't, it searches the next row and so on until it finds one that does contain 'Client'. Row 2 on the separate tab would then continue the search, but it wouldn't be filled with something if it doesn't find the word 'Client' - it instead would continue searching down until it found one that has the word in.
So for example - if the first ID that contains the right phrase is in Row 5, I want it to appear on the separate tab in Row 2, underneath the heading. Then, if the second ID with the correct phrase in column F is in Row 11 for example on the main tab, I then want it to be pulled through to Row 3 on the separate tab. And so on..
This will then allow me to do lookups for the rest of the values I want to input on the separate tab.
I've tried as many different IF statements as I can, but it's just not having it.
Any advice would be really appreciated.
You can use INDEX and AGGREGATE combination:
=IFERROR(INDEX($A$2:$A$6,AGGREGATE(15,6,1/($E$2:$E$6="Client")*ROW($E$2:$E$6)-1,ROW()-1)),"")
In Google Sheets you can use FILTER (docs) for that. Place it in the top cell of your column.
={
"Your Header";
IFNA(FILTER(A2:A, B2:B = "Client"))
}
If A2:A and B2:B are from other tab named My Tab it will be 'My Tab'!A2:A and 'My Tab'!B2:B.
Another beginners question, but this time about MS Access Controls.
I have a form where I have a list box full with many items.
What I need to do is when I double click on one of this item stored in the list box should all the textbox filled with an item stored on a different field from the same row where from my table.
I checked many tutorials already but didn't found a good solution.
Thanks for any help!
EDIT:
I have a table with several fields. The list box have the items from the first field(ID). The rest of the fields(Tile, Delivery Date, etc...) represented by text boxes in my form.
When I double Click on one item from the list box will populate the text boxes.
If I select the 5th item from my list box which represents the 5th row from my table every text box should have their item from the same row from the fields represented in the table.
I only want to edit the data stored in the table with this form.
Ok I finally get a solution for this one.
I using the DLOOKUP to get the data pulled to my form after the double-click event.
Dim ctrloop
For Each ctrloop In Me.lbReportID.ItemsSelected
strReportID = Me.lbReportID.ItemData(ctrloop)
Next ctrloop
Me.txtTitle = DLookup("[Title]", "tblreports", "[ID No] = '" & strReportID & "'")
The loop stores all report ID I have in my table. The DLOOKUP using this as a filter. It's like the WHERE in SQL.
When the program run will fill out my Title textbox looking through the title field in my tblreports table filtered with the strReportID.
It's working similarly like this SQL query which I using in a different textbox:
SELECT tblReports.[ID No]
FROM tblReports
WHERE (((tblReports.WorkPacage) = 'CDS'))
AND (((tblReports.State) <> 'Complete'));
In sql, if some fiels are to be left blank while inserting the values in the table, how shall we do it?
For eg. For name field, i want to insert 'First Name' & 'Last Name' but not 'Middle Name'.
But the field is already present by default in the table.
If I have understood you correctly, you simply need to execute an INSERT sentence, without using the columns (fields) you don't want to inform.
As an example, if you have three columns and don't want to inform column2 use
INSERT INTO table_name (column1,column3)
VALUES (value1,value3);
instead of
INSERT INTO table_name (column1,column2,column3)
VALUES (value1,value2,value3);
Hope it helps!