correct.
But I am importing a text file into access. The txt file looks something like this:
client date date time
roc_bu 05/19/2005 05/19/2005 01:57:54
and when you import something like this access changes this time to like a 12:12:20 AM so I came up with a function to convert this time to minutes and hours. No seconds. Below is the code.
To remove the seconds from the imported Time field, you don't need to convert the times into text strings.
After importing the text file into a table, make sure the Time field is set as Date/Time data type. Then you can remove the seconds from the Time field with an Update Query like this:-
UPDATE [ImportedTable] SET [Time] = [Time]-CDate("0:0:" & DatePart("s",[Time]))
Now to show the Times as 1:57 and 0:12 in the table (instead of showing 1:57:00 AM and 12:12:00 AM), you can simply
set the Format of the Time field as Short Time in table design.
In fact, you can search for something like >=#5:0# without using the Update Query to remove the seconds from the Time field (so long as the field is of Date/Time data type.) You can set the search criteria like this in query design view:-
Field: [Time]-CDate("0:0:" & DatePart("s",[Time]))
Show: uncheck
Criteria: >=#5:0#
Now only the hours and minutes in the Time field are searched as if the seconds were removed.
And since a Date/Time field is internally a numeric field, you can
even directly search the Time field for >=#5:0# without using
-CDate("0:0:" & DatePart("s",[Time]))
.