craigprice
Registered User.
- Local time
- Today, 02:39
- Joined
- Apr 8, 2013
- Messages
- 44
Hi,
Not sure if this is possible at all but I have a table with the following structure;
Etc etc. up to 31.
These are either filled with null values OR D or N
I am wanting to build an update query which will look at a form where a FROM and TO date are selected. I want to pass the day number of the FROM and day number from TO and add this to the column.
I want the query to then update all columns between the FROM and TO
eg [FROMDATE]DAY and [TODATE]DAY.
Is this possible at all?
Thanks
UPDATE:
I have come across this to make a query on the fly which may work - is there a way in which I can select it to add columns between each other. For example between Dayfrom as day05 and to to as day07 it would also add day06?
Not sure if this is possible at all but I have a table with the following structure;
Code:
01DAY | 01NIGHT | 02DAY | 02NIGHT | 03DAY | 03NIGHT |
These are either filled with null values OR D or N
I am wanting to build an update query which will look at a form where a FROM and TO date are selected. I want to pass the day number of the FROM and day number from TO and add this to the column.
I want the query to then update all columns between the FROM and TO
eg [FROMDATE]DAY and [TODATE]DAY.
Is this possible at all?
Thanks
UPDATE:
I have come across this to make a query on the fly which may work - is there a way in which I can select it to add columns between each other. For example between Dayfrom as day05 and to to as day07 it would also add day06?
Code:
Dim db As DAO.Database
Set db = CurrentDb
Dim qdf As DAO.QueryDef
Dim newSQL As String
On Error Resume Next
DoCmd.DeleteObject acQuery, "tempQry"
On Error GoTo 0
newSQL = "Select [01night] From [tblrota] WHERE [colleague]=1"
Set qdf = db.CreateQueryDef("tempQry", newSQL)
Last edited: