Click here to Skip to main content
15,887,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to reference MS Access 2016 for use with DoCmd, etc. Pin
Mycroft Holmes16-Jan-18 20:23
professionalMycroft Holmes16-Jan-18 20:23 
GeneralRe: How to reference MS Access 2016 for use with DoCmd, etc. Pin
Johan Hakkesteegt16-Jan-18 21:02
Johan Hakkesteegt16-Jan-18 21:02 
AnswerRe: How to reference MS Access 2016 for use with DoCmd, etc. Pin
Ash_savvy2-Feb-18 18:30
Ash_savvy2-Feb-18 18:30 
QuestionCan you include properties from a common class (Solved) Pin
mo14929-Jan-18 3:25
mo14929-Jan-18 3:25 
QuestionNeed help with date to date calculation of a total of different rows Pin
mokhtar_one5-Jan-18 23:39
mokhtar_one5-Jan-18 23:39 
QuestionRe: Need help with date to date calculation of a total of different rows Pin
Maciej Los8-Jan-18 7:11
mveMaciej Los8-Jan-18 7:11 
AnswerRe: Need help with date to date calculation of a total of different rows Pin
mokhtar_one8-Jan-18 22:30
mokhtar_one8-Jan-18 22:30 
AnswerRe: Need help with date to date calculation of a total of different rows Pin
Maciej Los8-Jan-18 22:43
mveMaciej Los8-Jan-18 22:43 
Your code is SQLInjection vulnerable.

[EDIT] Please read Dave's comment below to find out why.[/EDIT]

To avoid that you have to use parameters, for example:
VB
Dim dtDate1 as DateTime = CalendarControl1.Value
Dim dtDate2 as DateTime = CalendarControl2.Value

Dim cmd1 As OleDbCommand = New OleDbCommand("SELECT * FROM YourTable Where stdate BETWEEN @dt1 AND @dt2;")
cmd1.Parameters.AddWithValue(@dt1, dtDate1)
cmd1.Parameters.AddWithValue(@dt2, dtDate2)
'...

For further details, please see: OleDbCommand.Parameters Property (System.Data.OleDb)

[EDIT2]
Assuming that you want to...
Quote:
filtre total of transaction "by a single day" .

You have to use COUNT() function and convert datetime data time into date:
SQL
SELECT CONVERT(DATE, stdata), COUNT(*) AS TotalCountOfTransaction
FROM TransactionTable
GROUP BY CONVERT(DATE, stdata)
[/EDIT2]
Above query returns the count of transaction for every single day. If you would like to define the range of dates, use WHERE clause.

modified 9-Jan-18 11:02am.

GeneralRe: Need help with date to date calculation of a total of different rows Pin
A_Griffin8-Jan-18 23:05
A_Griffin8-Jan-18 23:05 
GeneralRe: Need help with date to date calculation of a total of different rows Pin
Dave Kreskowiak9-Jan-18 2:47
mveDave Kreskowiak9-Jan-18 2:47 
PraiseRe: Need help with date to date calculation of a total of different rows Pin
Maciej Los9-Jan-18 4:47
mveMaciej Los9-Jan-18 4:47 
GeneralRe: Need help with date to date calculation of a total of different rows Pin
Maciej Los9-Jan-18 5:07
mveMaciej Los9-Jan-18 5:07 
GeneralRe: Need help with date to date calculation of a total of different rows Pin
A_Griffin9-Jan-18 5:42
A_Griffin9-Jan-18 5:42 
GeneralRe: Need help with date to date calculation of a total of different rows Pin
Maciej Los9-Jan-18 6:47
mveMaciej Los9-Jan-18 6:47 
GeneralRe: Need help with date to date calculation of a total of different rows Pin
A_Griffin8-Jan-18 23:28
A_Griffin8-Jan-18 23:28 
QuestionBy Excel VBA how we can act on web page components (eg. buttons) of new FireFox releases (48+)? Pin
Member 136092555-Jan-18 16:32
Member 136092555-Jan-18 16:32 
AnswerRe: By Excel VBA how we can act on web page components (eg. buttons) of new FireFox releases (48+)? Pin
Maciej Los8-Jan-18 7:10
mveMaciej Los8-Jan-18 7:10 
Questionlistview groupstate Pin
JR2124-Jan-18 3:05
JR2124-Jan-18 3:05 
AnswerRe: listview groupstate Pin
JR2128-Jan-18 2:55
JR2128-Jan-18 2:55 
AnswerRe: listview groupstate Pin
phil.o8-Jan-18 11:24
professionalphil.o8-Jan-18 11:24 
GeneralRe: listview groupstate Pin
JR2128-Jan-18 21:27
JR2128-Jan-18 21:27 
GeneralRe: listview groupstate Pin
phil.o9-Jan-18 3:09
professionalphil.o9-Jan-18 3:09 
QuestionOrganization Chart in vb 6 Pin
Ayat Setiawan26-Dec-17 21:45
Ayat Setiawan26-Dec-17 21:45 
AnswerRe: Organization Chart in vb 6 Pin
Richard MacCutchan26-Dec-17 22:38
mveRichard MacCutchan26-Dec-17 22:38 
AnswerRe: Organization Chart in vb 6 Pin
Dave Kreskowiak27-Dec-17 4:43
mveDave Kreskowiak27-Dec-17 4:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.