Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21349

Using Datepart and Dateserial in SQL query

$
0
0
hello,

I trying to execute the following sql query on Access database, to get those records which have DOB (a date) greater than 7 days than datetill (a Date)

Bdaystr = "Select * From MemberRegister Where DateDiff(" & "'" & "d" & "'" & ",#" & datetill & "#, DateSerial(" & curyear & ",DatePart(" & "'" & "m" & "'" & ",DOB),DatePart(" & "'" & "d" & "'" & ",DOB))) >= 7 ;"

I am getting error data type mismatch.

Viewing all articles
Browse latest Browse all 21349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>