Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (4k points)

I have a table test with only one column in it named start_date I want to insert all the dates between two dates for example if I consider 1/7/2014 to 3/7/2014 I need dates as 1/7/2014,2/7/2014,3/7/2014 in my table, but I have problem inserting the code I used is as follows

1 Answer

0 votes
by (8.7k points)

The first step needed to  your code is to start with removing the appropriate errors before moving further as for smooth execution of program.

Below code will help to insert values into the database :

Dim StrSQL As String

Dim InDate As Date

Dim DatDiff As Integer

 

InDate = Me.FromDateTxt

 

StrSQL = "INSERT INTO Test (Start_Date) VALUES ('" & InDate & "' );"

 

DoCmd.SetWarnings False

DoCmd.RunSQL StrSQL

DoCmd.SetWarnings True

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Dec 18, 2020 in SQL by Appu (6.1k points)
0 votes
4 answers
asked Feb 25, 2021 in SQL by RohitSingh (2.6k points)
0 votes
4 answers

Browse Categories

...