Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42437

Using DatePart in SQL

$
0
0
I have a table called Requests and I'd like to return values grouped by the month value of a field named 'Sentdate' which is formatted in the database as a General Date. I tried the following but gat a "no value given for one or more parameters" error. What am I doing wrong?

rs.Open "SELECT count(*), DatePart(month, SentDate) FROM Requests group by SentDate", cn, adOpenDynamic, adLockOptimistic

Viewing all articles
Browse latest Browse all 42437

Trending Articles



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