[英]Access SQL query involving Switch statement VB.NET
If Demographic = "Age" Then
Demographic = "SELECT COUNT(CustomerID) As Result, Switch(
DateDiff(yyyy, DOB, Date()) >40, 40,
DateDiff(yyyy, DOB, Date()) >25, 25,
DateDiff(yyyy, DOB, Date()) >20, 20,
DateDiff(yyyy, DOB, Date()) >10, 10
) AS Age_Group
FROM tblCustomer
GROUP BY Switch(
DateDiff(yyyy, DOB, Date()) >40, 40,
DateDiff(yyyy, DOB, Date()) >25, 25,
DateDiff(yyyy, DOB, Date()) >20, 20,
DateDiff(yyyy, DOB, Date()) >10, 10
), Result"
I have been trying to use a select case statement to create a graph of the number of records within each age group from the date of birth and the current date. 我一直在尝试使用select case语句创建从出生日期到当前日期每个年龄段内的记录数图表。 I keep getting the error 我不断收到错误
No value given for one or more required parameters. 没有为一个或多个必需参数给出值。
And I have no idea why, any help with this or just a better method would be greatly appreciated. 而且我不知道为什么,对此方法的任何帮助或只是更好的方法,将不胜感激。
从分组依据中删除结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.