I Want the Sum of column in textbox using vb6 and access

After Entering Dates in FromDate And To Date The Sum Of Column BalanceAmount Between These Dates Should Appear in Textbox2

why not use the DatePicker control in entering dates

Oh something like...

strSQL = "SELECT SUM(numericfieldname) FROM tablename WHERE datefieldname >= #" & "01/01/2010" & "# AND datefieldname <= #" & "01/30/2010" & "#"

Now, the above is for access only as SQL server will give you an error if you try an execute the above query. You will also notice that the above is inclusive of from and to dates. To make it none inclusive, ie exclusive, remove the equals signs.

Or you could use the between operator but I will let you look that up in Access help files...


Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.