如何从Access数据库中选择vb.net中的每月数据 [英] How to select monthly data in vb.net from Access Database

查看:87
本文介绍了如何从Access数据库中选择vb.net中的每月数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,如何从表中选择月度数据包含很长时间的数据,

例如

field1 = date1

field2 =学位



如何获得某一年的每个月(jan,feb ...)的最大学位并在一张桌子中查看。

Hello,how to select monthly data from a table contains data for long time,
for example
field1 = date1
field2 = degree

how to get the max degree for each months (jan,feb...)for certain year and view it in one table.

推荐答案

尝试如下

try like below
select max(degree), Format(date1, "mmm")
from table1
group by Format(date1, "mmm")


SELECT
    DATEADD(month, DATEDIFF(month, 0, t.Date1), 0) AS Date1
    , MAX(degree) AS MaxDegree
FROM
    table1 t
WHERE
    YEAR(t.Date1) IN (2014)
GROUP BY
    DATEADD(month, DATEDIFF(month, 0, t.Date1), 0)


这篇关于如何从Access数据库中选择vb.net中的每月数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆