获取当前月份和上个月的数据 [英] get data from current month and previous month

查看:102
本文介绍了获取当前月份和上个月的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我有一个包含两列从日期"和到日期"的表.
我想获取当月和上个月的数据.

如何编写查询?

我怎样才能得到上个月?

我没有将任何参数传递给存储过程.
我只想要当月和上个月的数据.
基于表格的起始日期"列.



Minal Shah.

Hi!

I have a table with two columns From Date and To Date.
i want to get data from current month and previous month.

how can i write my query?

how can i get previous month?

i am not passing any parameters to Store Procedure.
i just want the data of current month and previous month.
based on the From date column of my table.



Minal Shah.

推荐答案

看看

您可以将有问题的两个日期作为参数传递给存储过程,然后编写未保留的存储过程.
You could pass the two dates in question as parameters to a stored procedure, and then write an unencumbered stored proc.


这篇关于获取当前月份和上个月的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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