Add Extra Field to SQL Syntax

burrina

Registered User.
Local time
Today, 13:14
Joined
May 10, 2014
Messages
972
I need to add HolDte and make it also use HolidayDate as it's criteria.

PHP:
strSQL = "INSERT INTO tblHour (WorkDate,Hours,HolDay,EmployeeID) " _
          & " VALUES  (#" & Me.HolidayDate & "#," & Me.txtHrs & ",True," & Me.EmployeeID & ")"
 
You insert one new record, (so what should the criteria be)!
 
To Make HolDte (a Date) match HolidayDate since that is a field in which I have a Composite Key.
 
Sorry what, (can you show some sample data + how you want it)?
 
Here is a Screenshot. HolDte should equal HolidayDate
 

Attachments

  • tblHour.jpg
    tblHour.jpg
    48.8 KB · Views: 82
  • tblHourCompIndex.jpg
    tblHourCompIndex.jpg
    52.8 KB · Views: 79
Hmm - would the below not do that?
Code:
[COLOR=#000000][COLOR=#0000BB]strSQL [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"INSERT INTO tblHour (WorkDate,Hours,HolDay,EmployeeID, [/COLOR][/COLOR][COLOR=#000000][COLOR=#DD0000]HolDte) " [/COLOR][COLOR=#0000BB]_ 
          [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#DD0000]" VALUES  (#" [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000BB]Me[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]HolidayDate [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#DD0000]"#," [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000BB]Me[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]txtHrs [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#DD0000]",True," [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000BB]Me[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]EmployeeID [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#DD0000]", [/COLOR][/COLOR][COLOR=#000000][COLOR=#DD0000][COLOR=#000000][COLOR=#DD0000]#" [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000BB]Me[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]HolidayDate [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#DD0000]"#[/COLOR][/COLOR])"[/COLOR][/COLOR]
 
Yes, Thanks Again. I'm learning. I appreciate the help.
Just what I needed.
 
You're welcome, (it was so straightforward so I thought it couldn't be what you were after). :)
 

Users who are viewing this thread

Back
Top Bottom