如何在两个月内获得参赛作品(即As_Of_Date ='2014-02-28'和'2014-02-28') [英] How to get entries in both month (i.e As_Of_Date='2014-02-28' and '2014-02-28')
本文介绍了如何在两个月内获得参赛作品(即As_Of_Date ='2014-02-28'和'2014-02-28')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
My data is in foll format
ID| UID | Branch_Code | Transaction_Date | Description | Amount_Final | As_Of_Date ||
1| zaere | 0 | 20-08-2004 | Description1 | 39232 | 31-01-2014 ||
2| zaere | 0 | 23-03-2011 | Description2 | 80 | 31-01-2014 ||
3| zaere | 0 | 20-08-2004 | Description1 | 39232 | 28-02-2014 ||
4| zaere | 0 | 23-03-2011 | Description2 | 80 | 28-02-2014 ||
5| zaere | 0 | 23-03-2011 | Description2 | 80 | 28-02-2014 ||
6| abc | 0 | 24-03-2011 | Descri |100 | 28-02-2014 ||
7| pqr | 0 | 11-03-2011 | Des | 2000 | 31-01-2014 ||
我需要提取当前月份(2014年2月28日)以及上个月(31-)存在的未完成条目01-2014)
I need to fetch Outstanding Entries, those which exists in current month(28-02-2014) as well as previous month( 31-01-2014 )
推荐答案
请阅读问题的评论。
Please, read comments to the question.
SELECT <FieldList>
FROM <TableName>
WHERE As_of_Date BETWEEN '01-01-2014' AND '28-02-2014'
从你的问题来看,这两个日期并不完全清楚你想找到看起来是一样的...
但是......尝试这样的事情:
It's not exactly clear from your question, since the two dates you want to find appear to be the same...
But... Try something like this:
SELECT * FROM MyTable WHERE As_Of_Date = '2014-02-28' OR As_Of_Date = '2014-01-31'
这篇关于如何在两个月内获得参赛作品(即As_Of_Date ='2014-02-28'和'2014-02-28')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文