
Can you give me a few lines of code to explain your observation?
It would take more than a few lines of code, I'm afraid. Firstly, I think you need to work at getting a better understanding of how relational databases work. You might like to take a look at DatabaseBasics.zip in my Dropbox public databases folder at:
This little demo file, as its name implies, is designed to give a simple introduction to the database relational model, how it is implemented by means of a set of correctly normalized related tables, and how these are reflected in the user interface of forms and subforms.
As regards the current issue I find it difficult to see why you need all these tables. You said in your original post 'This SQL statement converts the signal-hour fields into universal UTC military time'. However, the current Coordinated Universal Time (UTC) value can be returned by calling the GetUTC() function from the following module. This calls the Windows API GetSystemTime function:
' basUTC
' returns current date/time as UTC (Coordinated Universal Time)
' by calling GetUTC() function
Option Compare Database
Option Explicit
Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Declare PtrSafe Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)
Public Function GetUTC() As Date
Dim utctime As SYSTEMTIME
GetSystemTime utctime ' put the time and date in UTC time into utctime
With utctime
GetUTC = DateSerial(.wYear, .wMonth, .wDay) + TimeSerial(.wHour, .wMinute, .wSecond)
End With
End Function
To return the UTC Time for a local date/time value the following simple little function calls the above function:
Public Function Local2UTC(dtmLocal As Date) As Date
Dim dtmDifference As Date
' get difference between local date/time and UTC
dtmDifference = Now() - GetUTC()
' convert local date/time to UTC by subtracting difference from local date/time
Local2UTC = dtmLocal - dtmDifference
End Function
So, whenever you need to return the UTC date/time for any local date/time value in the database you can just call the Local2UTC function, passing the local date/time into the function. Here is an example in the immediate window for 6:00 PM today:
? Local2UTC(#2025-05-26 18:00:00#)
26/05/2025 17:00:00
You can of course format the return value in whatever date/time format you want by calling the Format function.