Queries :: Put INSERT INTO Statement In A Query?
Apr 3, 2013Where would you put the INSERT INTO statement in a query? Would it go after the select statement but before the From statement or would it go at the end?
View RepliesWhere would you put the INSERT INTO statement in a query? Would it go after the select statement but before the From statement or would it go at the end?
View RepliesI have two tables each with an ID field (autonumber/PK/No Dup etc).
I want to append two fields from one table to the other table. I have set up an Append Query to do this but it won't work - I get the following error - "The INSERT INTO statement contains the following unknown field: 'FiID'...."
I want to insert an if statement in Access report that states.If the interviewer field is not null them put in the interviewer. If it is null then don't put anything.I have 5 of the interviewer fields and don't want empty lines in the report.
View 1 Replies View Relatedwhat is wrong with the following statements. I'm new to access SQl. This would work in ms sql.
Code:
DELETE from Table1
INSERT INTO Table1(email, productid, datecreated, datesend) values ('adf', 5, '10/10/2012','10/10/2012')
Select * from Table1
SQL stored procedure which is simple INSERT statement on a single table 'tblSOF'
Code:
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter values below.
[Code] ....
I am stumped with the following error.
Error: Msg 102, Level 15, State 1, Procedure InsertINTO_tblSOF_sp, Line 80 Incorrect syntax near ')'.
hello all
after many hours of reading access help, for my update command button,
not sure what i did wrong...
when I on the update button, its give me blank space on the table where all my contacts are stored,
I trying to updated existing client contact info, without changing contact name,
I have contact form with drop down menu, where I select clients name and view and clients information,
Update
"'" & Me!TbxComp & "', " & _
"'" & Me!TbxStreet & "', " & _
"'" & Me!TbxFloor & "', " & _
"'" & Me!TbxCityStateZip & "', " & _
"'" & Me!Telephone & "', " & _
"'" & Me!TbxFax & "', " & _
"'" & Me!TbxAcctMgr & "', " & _
"'" & Me!TbxEmail & "')"
-----------------------------------------
here is what my form code looks like,
Private Sub cboContact_AfterUpdate()
Dim ContactID As String
Dim rst As DAO.Recordset
ContactID = "SELECT * FROM Contacts " & " WHERE ContactName = '" _
& Me!cboContact.Value & "'"
Set rst = CurrentDb.OpenRecordset(ContactID, dbOpenDynaset)
If rst.EOF = True And rst.BOF = True Then
Call MsgBox("The Contact Name you entered does not exist")
Else
Me!Telephone = rst!Telephone
Me!TbxFax = rst!Fax
Me!TbxComp = rst!Company
Me!TbxFloor = rst!Floor
Me!TbxStreet = rst!Street
Me!TbxCityStateZip = rst!CityStateZip
Me!TbxEmail = rst!Email
Me!TbxAcctMgr = rst!Manager
End If
Set rst = Nothing
End Sub
Private Sub Close_Click()
DoCmd.Close
End Sub
Private Sub Form_Load()
'Set Record Source for Forms as Contacts Table
Forms!Contacts.RecordSource = "Contacts"
End Sub
Private Sub Update_Contact_Click()
Dim QrySQL As String
QrySQL = "INSERT INTO [Contacts] " & _
"(ContactName, Company, Street, Floor, CityStateZip, Telephone, Fax, Manager, Email) " & _
"VALUES(" & _
"'" & Me!TbxContactName & "', " & _
"'" & Me!TbxComp & "', " & _
"'" & Me!TbxStreet & "', " & _
"'" & Me!TbxFloor & "', " & _
"'" & Me!TbxCityStateZip & "', " & _
"'" & Me!Telephone & "', " & _
"'" & Me!TbxFax & "', " & _
"'" & Me!TbxAcctMgr & "', " & _
"'" & Me!TbxEmail & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL QrySQL
DoCmd.SetWarnings True
MsgBox "Update Was Completed"
End Sub
please note: i have very little programming skills
Not sure if I explained this correctly..
Thank you
Your help is greatly appreciated
AA
Hi there,
I am trying to perform an INSERT into a linked Oracle Table, using the following code:
INSERT INTO JTCS_OWNER_VISITS
SELECT *
FROM Visits;
Seems simple enough, there are 10,000 records in the visits table, but when i try to run this query i get an error message that simply says 'OverFlow' but no error code. This query worked earlier when i only tried to insert 1,800 records, can anyone tell me if there is a limit to the number of records i can insert. I have linked the oracle tables using ODBC drivers (SQORA32.dll) and this has worked fine against all of the other tables except this one...
Thanks
Dan
I've created a new table to hold information about female customers and it would be nice if I could glance through it in alphabetical order of their surnames.
INSERT INTO TBL_FEMALE_CUSTOMERS
SELECT *
FROM TBL_CUSTOMERS
WHERE GENDER='F'
ORDER BY SURNAME ;
In MS Access the resulting table data is NOT sorted by surname, but it works fine when I'm using my trusty SQL Server database. Can this be done in Access?
...and yes, I know I just need to use a query to sort the data, but I'm more interested to find out why it works in SQL Server and not Access.
Cheers,
Sam
Is it possible to have an insert and update in the same sql statement using MS Access 2002? I could split it into seperate statements but for code purity I would like to have it in one :cool:
View 2 Replies View Relatedhi guys i have a form that comes from a query with a parent and child table. Main table pk is pricingid and then the foreign key in tblHistory is pricingid.
I am trying to do an append table but i keep getting an error message
Pricing ID is the pk autonumber in tblPricing (parent table)
historyid is the pk in tblHistory and pricingid the fk(child table)
oldprice should be a currency value
the other fields are text.
this is my code:
strSQL = "Insert into tblHistory (DateChanged, Edit_UserName, OldPrice) Values(#" & now() & "#, '" & getusername() &"', " & Me.txtPrice.OldValue & ")
but i get the error message
You cannot or change a record because a related record is required in table tblPricing
any advise... i know i need to select somehow the pricingId from the parenttable, but how do i do that?
this is what I have with all the syntax problems on the insert statement
Private Sub Save_Click()
'On Error GoTo Err_Save_Click
DoCmd.SetWarnings False
Dim EntryTime As String
Dim lsupervisor As String
Dim sSemester As String
Dim selectRequirementid1 As String
Dim selectRequirementid2 As String
Dim selectRequirementid3 As String
Dim selectRequirementid4 As String
Dim selectRequirementid5 As String
Dim selectRequirementid6 As String
Dim selectRequirementid7 As String
Dim selectRequirementid8 As String
Dim selectRequirementid9 As String
Dim selectRequirementid10 As String
Dim selectRequirementid11 As String
Dim selectRequirementid12 As String
Dim sRequirement1 As String
Dim sRequirement2 As String
Dim sRequirement3 As String
Dim sRequirement4 As String
Dim sRequirement5 As String
Dim sRequirement6 As String
Dim sRequirement7 As String
Dim sRequirement8 As String
Dim sRequirement9 As String
Dim sRequirement10 As String
Dim sRequirement11 As String
Dim sRequirement12 As String
lsupervisor = Me.Supervisor1.Column(0)
sSemester = Me.Semester1.value
EntryTime = Format(Now, "dddd, mmmm d, yyyy, hh:mm:ss AMPM")
sRequirement1 = Me.category1.value & ">" & Me.subcategory1.value & ">" & Me!Label1.Caption
selectRequirementid1 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement1] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement2 = category1.value & ">" & subcategory1.value & ">" & Me!Label2.Caption
selectRequirementid2 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement2] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement3 = category1.value & ">" & subcategory1.value & ">" & Me!Label3.Caption
selectRequirementid3 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement3] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement4 = category1.value & ">" & subcategory1.value & ">" & Me!Label4.Caption
selectRequirementid4 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement4] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement5 = category1.value & ">" & subcategory1.value & ">" & Me!Label5.Caption
selectRequirementid5 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement5] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement6 = category1.value & ">" & subcategory1.value & ">" & Me!Label6.Caption
selectRequirementid6 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement6] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement7 = category1.value & ">" & subcategory1.value & ">" & Me!Label7.Caption
selectRequirementid7 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement7] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement8 = category1.value & ">" & subcategory1.value & ">" & Me!Label8.Caption
selectRequirementid8 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement8] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement9 = category1.value & ">" & subcategory1.value & ">" & Me!Label9.Caption
selectRequirementid9 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement9] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement10 = category1.value & ">" & subcategory1.value & ">" & Me!Label10.Caption
selectRequirementid10 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement10] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement11 = category1.value
selectRequirementid11 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement11] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
sRequirement12 = category1.value & ">" & subcategory1.value
selectRequirementid12 = "SELECT Requirements.RequirementID " & _
"FROM Requirements " & _
"WHERE Requirements.RequirementName = '" + [sRequirement12] + "' " & _
"AND Requirements.Area = '" & Me.AArea1.value & "' " & _
"AND Requirements.Level = '" & Me.level1.value & "' "
DoCmd.RunSQL "INSERT INTO Hours ([UniversityID], [LicenseNumber], [SiteName], [RequirementID1], [RequirementID2], [RequirementID3], [RequirementID4], [RequirementID5], [RequirementID6], [RequirementID7], [RequirementID8], [RequirementID9], [RequirementID10], [RequirementID11], [RequirementID12], [Semester], [HoursCompleted1], [HoursCompleted2], [HoursCompleted3], [HoursCompleted4], [HoursCompleted5], [HoursCompleted6], [HoursCompleted7], [HoursCompleted8], [HoursCompleted9], [HoursCompleted10], [HoursCompleted11], [HoursCompleted12], [EntryTime], [Comments]) " & _
" VALUES('" & UniversityID1 & "', '" + [lsupervisor] + "', '" & SiteName1 & "', '" + [selectRequirementid1] + "', '" + [selectRequirementid2] + "', '" + [selectRequirementid3] + "', '" + [selectRequirementid4] + "', '" + [selectRequirementid5] + "', '" + [selectRequirementid6] + "', '" + [selectRequirementid7] + "', '" + [selectRequirementid8] + "', '" + [selectRequirementid9] + "', '" + [selectRequirementid10] + "', '" + [selectRequirementid11] + "', '" + [selectRequirementid12] + "', '" + [sSemester] + "', '" & hours1 & "', '" & hours2 & "', '" & hours3 & "', '" & hours4 & "', '" & hours5 & "', '" & hours6 & "', '" & hours7 & "', '" & hours8 & "', '" & hours9 & "', '" & hours10 & "', '" & categoryhours & "', '" & subcategoryhours & "', '" + [EntryTime] + "', '" & Comments & "'); "
End Sub
Hi
Help please
My code looks something like this and it work fine by producing an email and inserting into an access database
My problem is I also want to insert a timestamp into the column that already exists in the database and I just can't get the syntax right
SQL= "INSERT INTO Employees "
SQL= mySQL & "(FirstName,LastName,Address,City,Region,PostalCode ) "
SQL= SQL & "VALUES ('" & Request.Form("FirstName") & "','"
SQL= SQL & Request.Form("LastName") & "','"
SQL= SQL & Request.Form("Address") & "','"
SQL= SQL & Request.Form("City") & "','"
SQL= SQL & Request.Form("Region") & "','"
SQL= SQL & Request.Form("PostalCode") & "')"
I appreciate I might have to do
SQL= "INSERT INTO Employees "
SQL= mySQL & "(FirstName,LastName,Address,City,Region,PostalCode ,timestamp) "
SQL= SQL & "VALUES ('" & Request.Form("FirstName") & "','"
SQL= SQL & Request.Form("LastName") & "','"
SQL= SQL & Request.Form("Address") & "','"
SQL= SQL & Request.Form("City") & "','"
SQL= SQL & Request.Form("Region") & "','"
SQL= SQL & Request.Form("PostalCode") & "')"
but I cannot for the life of me workout the SQL line needed
Help would be much appreciated
Hi everyone,
I'm kind of new to web development but not so much programming. I went to school for 2 years for C and C++ programming, as well as some database stuff... anyways , I'm having some trouble doing a simple INSERT INTO statement...
What I'd like to do is to insert a new row using two session variables, first of all I'm not entirely sure if this works? but I've tried a bunch of different things but I just cant seem to get it to work...
Here is my insert statement:
sqlInsert = "INSERT INTO Events (Participant_Code,Date)
VALUES ('" & code & "','" & date & "')"
Now I've tried both, where I have a variable that has Session("code") and another with Session("date") as well as just using Session("code") where the variable is in the insert.
Here is the whole code, I have a file called database.asp that has function that can be called to open, read, update or close a connection.
call connection("writeyourselffree2.mdb")
sqlInsert = "INSERT INTO Events (Participant_Code,Date)
VALUES ('" & code & "','" & date & "')"
call rsUpdate(sql, conn)
call close(conn)
Heres the error that I have right now:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Anyways I appreciate any help you can give me!
Cheers
If I use this INSERT it works fine :
Code:
strSQL = "Insert into tblParkeerbeheer_log select * from parkeerbeheer where [ID] = " & Forms![parkeerbeheer]![fldID].Value & ""
DoCmd.RunSQL strSQL
But if I want to do the same with multiple records with Pnummer (personell number) as criteria in the WHERE clause :
Code:
strSQL = "Insert into tblParkeerbeheer_log select * from parkeerbeheer where [Pnummer] = " & Forms![parkeerbeheer]![Pnummer].Value & ""
DoCmd.RunSQL strSQL
It asks me to prompt the personell numer, while that number is present within the prompt box
I have a field that is giving me the number of business days between a period of time and then I want to subtract that number - the person's PTO time to see the actual days they were available...when I simply type the number in (see below) it works great but I want to set up a prompt that will ask me how many PTO Days to calculate as it will be different for each person I am quering...is this possible?
View 9 Replies View RelatedDear members,
I have two databases, Source and destination ;
strSrceDB = "C:WSS_DBRehabilitated_Water_Supply_Kulyob.mdb"
StrDestDB = "C:DBWSS_Khatlon.mdb"
I would like to append records to the destination table (Contractor_GIS) when there are no matching records in the source table (Contractor).
My code is as follows:
Private Sub CommandButton1_Click()
Dim strTemp As String
Dim strSQL As String
Dim StrDestDB As String
Dim strSrceDB As String
Dim mdb As DAO.Database
On Error GoTo ErrorHandler
strSrceDB = "C:WSS_DBRehabilitated_Water_Supply_Kulyob.mdb"
StrDestDB = "C:DBWSS_Khatlon.mdb"
'Make sure it is there
If Dir(StrDestDB) = "" Then
Call MsgBox(StrDestDB & " does not exist", vbOKOnly, "Aborting...")
ElseIf Dir(strSrceDB) = "" Then
Call MsgBox(strSrceDB & " does not exist", vbOKOnly, "Aborting...")
Else
strSQL= "INSERT INTO Contractor_GIS("
strSQL = strSQL & "System_ID,"
strSQL = strSQL & "Contractor_Name)"
strSQL = strSQL & "IN '" & StrDestDB & "' "
strSQL= strSQL & "SELECT Contractor.System_ID,"
strSQL = strSQL & "Contractor.Contractor_Name "
strSQL = strSQL & "FROM Contractor IN '" & strSrceDB & "' "
strSQL = strSQL & "Contractor_GIS IN '" & StrDestDB & "' "
strSQL = strSQL & "where Contractor.System_ID <> Contractor_GIS.System_ID;"
Set mdb = DBEngine.OpenDatabase(StrDestDB)
Debug.Print strSQL
Call mdb.Execute(strSQL)
mdb.Close
Set mdb = Nothing
DoEvents
MsgBox ("The Geodatabase tables have been successfully appended!")
End If
Exit Sub
ErrorHandler:
strTemp = Err.Description & " [Update_SystemTab]"
Call MsgBox(strTemp, vbCritical, "Contact Help Desk")
End Sub
I get Syntax Error in "Insert into" clause.
Any help on this will be most appreciated.
Thanks in advance.
Irshad
What is the syntax error in this Insert Into statement ?
INSERT INTO RawData(RunID,fullName,name,category,type,subType, numberOfLines,virtual,date,namespace) SELECT 257 ,fullName,name,category,type,subType,numberOfLines ,virtual,#1/3/2007#,namespace FROM RawData WHERE namespace ='customer.demo' AND RunID =256
hi guys. i was hoping you guys could help me, i have a combo box "cbocontract" which gets populated according to a selection from another combobox(cboAll). now i have another combo box(cboStatus) which according to what the user selects in cbocontract list box it should display active or inactive, now i have the row source from the cboStatus like this:
SELECT DISTINCTROW Test.Status FROM TEST WHERE (TEST.Facility=forms![Change of Status]!txtInvoice.value) and (TEST.PM_Contract_ID=forms![Change of Status]!cboContract);
it works perfectly, however is there a way to make put this code in a text box? how do i insert the select distinctrow into a textbox??? it should only display one value according to what the user selects in the cbocontract combo box... also, the user should be able to edit this textbox.
:o
I'm now trying to speed up data entry within my database and have hit a brick wall with one part.Basically, this is within a form (for 'clauses') of which there is a one-to-one relationship with 'the Applicability' table (a series of fields with 'Yes/No' values for each and a related key field) - i.e. for each clause there are a series of circumstances when it will apply. I've set this up to create a record when one doesn't already exist using the default values (i.e. all applicable).
The method to speed up data entry is to have a pop-up form with unbound fields to list common Clause fields - including 'Applicability' as a subform. When entering a series of Clauses you tend to find they have the same 'Applicability' as their neighbour, so I would like to create a corresponding record in the Applicability table with the values set on the 'ClauseQuickAdd' form (Technically the 'ApplicabilityQuickAdd' sub form).I've edited an existing code within my database to provide two global variables (strAppFieldList and strSubAppFieldList) to put into the following statement:
Code:
DoCmd.RunSQL "INSERT INTO Applicability ( AppRelClause, "" & strAppFieldList & "") VALUES ("" & Me.Clause_ID & ", " & strSubAppFieldList & "")"
Bringing up Error 2498 "An expression you entered is the wrong data type for one of the arguments". So I presume that I haven't quite got the format right for transferring yes/no values (strSubAppFieldList). See below for an extract of strSubAppFieldList:
Code:
Forms('ClauseQuickAdd')![ApplicabilityQuickAdd]![Manufacturer], Forms('ClauseQuickAdd')![ApplicabilityQuickAdd]![Supplier], ...
I need my INSERT statement to DLookup tbl_module_repairs and insert the information from a field based on a WHERE condition of primary key matching on the form and table. Here is what I have but it will not work on the last value:
Code:
Dim lookModType1 As Variant
lookModType1 = DLookup("module_type", "tbl_module_repairs", "prikey = " & Me.txt_prikey1.Value & "")
SQLtext4 = "INSERT INTO TBL_RF_TECH_LOG ([TechID], ActionStatus, Barcode, EquipmentDescription) Values (Left([txt_techid_rework_in], 2),'In Rework', '" & Me.txt_bc1 & "', " & lookModType1 & ");"
DoCmd.RunSQL SQLtext4
Note: My DLookup works fine by itself for other uses.
I have an append query that contains an IIF statement. I want to code that into a VBA function. The SQL view of the query looks like this:
Code:
INSERT INTO tmpAvailInv ( NUID, Inv_Name, F_Name, M_Name, L_Name, Role )
SELECT tblPeople.NUID, tblPeople.[F_name] & IIf(IsNull([M_Name])," "," " & [M_Name] & " ") & [L_Name] AS Inv_Name, tblPeople.F_Name, tblPeople.M_Name, tblPeople.L_Name, tblPeople.Role
FROM tblPeople
WHERE (((tblPeople.Role)="Investigator") AND ((tblPeople.Archive)=False));
What I wrote for the VBA code is this:
Code:
Dim strSQL As String
Dim db As Database
Set db = CurrentDb
[code]....
Where it chokes is on the IIF statement with the double-quotes in it. I've tried several combinations with single quotes and double double-quotes. I'm just not getting it.
The row source for the combo-box is
SELECT tbl_p.P_ID, [plast] & " , " & [pFirst] AS Expr1 FROM tbl_p ORDER BY [plast] & " , " & [pFirst];
If notinlist I would like to add the the new name, how should I write the INSERT Statement?
i'm trying to execute an insert statement from an ASP.Net form page such as:
insert into documents (Name,NameFrench,Message,MessageFrench) values('info','information','See details ','Voir l'affiche pour des details');
I get an exception on the insert statement.
If I copy the statement directly into a test query in the database, I get the following error: Syntax error (missing operator) in query expression "Voir l'affiche .... "
The insert dies on the " l'affiche " word. I need the those french characters in the database as they are pulled from those fields and are required to be displayed with the proper accent characters.
know a way to escape the French special characters?
I am using an Access 2010 DB to keep track of a schedule. Essentially, at least one person needs to be signed up to work for every hour of every day in a week.
Tables:
Days with 7 records
Hours with 24 records
Workers with as many people that sign up to work the different hours
Schedule signifying the worker, day, and hour which are signed up.
As of now i have a query that relates these results and gives me a line detailing the worker/time information for the slots that are signed up for.What I'm TRYING to do is to create a query that gives me BLANK worker info when there is no one signed up for a particular hour.Currently my Schedule table has the following:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
16 | 5 | 15
What I'm looking to do is have this table matched up with another table (or query) that provides every combination of day/hour. When an day/hour combination is skipped, the query will be able to "fill in the blank" with a row. Like this:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
| | 14
16 | 5 | 15
I work with access web database. In access web aggregate functions are disabled in query design. So I made a query in client and i thought then i can insert this data to another web table. but i don't know how to update this table.
Because the source table of the query is also updated.
I upload the database with a table in it and a query. I want to add the data of this query to another web table....
In my statment below the ID is an autonumber. I placed it in the first part ofthe SQL string..but not where I have to variables referenced...
I have to add it to the SQL statement...Its not a varible although I can make it one by getting the largest number nad adding one...
Do I have to make it a non-autonumber and do it like I said above
Or is there another way to treat the autonumber (ID) in the SQL INSERT INTO statement...
THanks
Code:MySQL = "INSERT INTO dbo_data ("MySQL = MySQL & "ID,Name,Owners_Residence,Notice_Expiration,Notes,N otice_Number,Status,Notice_Date,Property_Address,N uisance_Type,Addition_Name,Range,Lot,Block,Zip_Cod e,Display_PID,Sec_tion,Township,Property_City,Prop erty_State,Property_Zip"MySQL = MySQL & ") values ("MySQL = MySQL & "'" & varName & "','" & varOwners_Residence & "','" & varNotice_Expiration & "','" & varNotes & "','" & varNotice_Number & "','" & varStatus & "','" & varNotice_Date & "','" & varProperty_Address & "','" & varNuisance_Type & "','" & varAddition_Name & "','" & varRange & "','" & varLot & "','" & varBlock & "','" & varProperty_Zip & "','" & varDisplay_PID & "','" & varSec_tion & "','" & varTownship & "','" & varProperty_City & "','" & varProperty_State & "','" & varZip_Code & "'"MySQL = MySQL & ");"