TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rajavel G
NA
95
44.6k
sql query between date in vb
Jan 11 2017 5:35 AM
Try
d1 = dtpfrom.Value.Date()
d2 = dtpto.Value.Date()
SQL = "SELECT Student_ID FROM Ate_entry"
execComDB(SQL)
reader = cmd.ExecuteReader()
If reader.Read() Then
reader.Close()
Try
SQL = "SELECT Student_regno,Student_Std,Student_branch,Attendance_Date,Attendance_Status,Entry_User,Entry_Date,Entry_Time FROM Ate_entry where Student_ID='" & txtstuid.Text & "' and (Attendance_Date Between '" & d1 & "' AND '" & d2 & "')"
'cmd.Parameters.AddWithValue("@from", dtpfrom.Text) ("SELECT * from stockitems where stdate Between #" & _ dtDate1.ToString("MM/dd/yyyy") & "# And #" & _dtDate2.ToString("MM/dd/yyyy") & "#",con)
'cmd.Parameters.AddWithValue("@to", dtpto.Text)
execComDB(SQL)..
..
I am using this code but it not including the year....only taking month and date....
Reply
Answers (
2
)
page level tracing execution store in database
Convert existing node to xml attribute