aziz rasul
Active member
- Local time
- Today, 13:55
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have the following SQL string.
strSQL = "INSERT INTO " & strTableName & " (NPC, FIN_PERIOD, FIN_WEEK, FINANCIALYEAR, LINES_REQUESTED, LINES_SUPPLIED, REQ_QTY, SUP_QTY, TOT_COST, TOT_SALES, DATETIMEVALUE) " & _
"VALUES ('" & rst.Fields(0) & "', " & rst.Fields(1) & ", " & rst.Fields(2) & ", " & Forms!frmRefreshData!cboYear & ", " & rst.Fields(3) & ", " & rst.Fields(4) & ", " & rst.Fields(5) & ", " & rst.Fields(6) & ", " & rst.Fields(7) & ", " & rst.Fields(8) & ", #" & Now() & "#);"
In the [DATETIMEVALUE] field I get a typical value like
05/06/2023 11:30:05
However when I hover the cursor in the code over the Now() function, I get 23/06/05 11:30:05 which is how I want it. How can I use the Format function so that I can get this?
strSQL = "INSERT INTO " & strTableName & " (NPC, FIN_PERIOD, FIN_WEEK, FINANCIALYEAR, LINES_REQUESTED, LINES_SUPPLIED, REQ_QTY, SUP_QTY, TOT_COST, TOT_SALES, DATETIMEVALUE) " & _
"VALUES ('" & rst.Fields(0) & "', " & rst.Fields(1) & ", " & rst.Fields(2) & ", " & Forms!frmRefreshData!cboYear & ", " & rst.Fields(3) & ", " & rst.Fields(4) & ", " & rst.Fields(5) & ", " & rst.Fields(6) & ", " & rst.Fields(7) & ", " & rst.Fields(8) & ", #" & Now() & "#);"
In the [DATETIMEVALUE] field I get a typical value like
05/06/2023 11:30:05
However when I hover the cursor in the code over the Now() function, I get 23/06/05 11:30:05 which is how I want it. How can I use the Format function so that I can get this?