473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get every month 20 date from a table

Dear All,

I want to create a view and the view only should get those rows from a table which a dateColumn has in this format(MM/DD/YYYY) this date(XX/20/XXXX) date for every month if the date is 21 in the view should not show that record, means for only one day the view should hold/keep the record.


thanks in advance.
Apr 21 '14 #1
4 1472
Luuk
1,047 Expert 1GB
my dateformat is se differntly, bu that should not make a difference, because the DATE is stored, and not a string representation of that date.

Expand|Select|Wrap|Line Numbers
  1. create table testDate (d date);
  2.  
  3. insert into testDate values('2014-01-01');
  4. insert into testDate values('2014-01-19');
  5. insert into testDate values('2014-01-20');
  6. insert into testDate values('2014-01-21');
  7.  
  8. select * from testDate where day(d)=20;
above will only return 1 row.
Apr 21 '14 #2
Dear Luuk,
i want to select all those record from a table whose 20 days are completed in the system, means ofter every 20 days the view should select those rows from the table whose 20 days are completed,

I have done as bellow but i am not sure its okay or not.

Expand|Select|Wrap|Line Numbers
  1. declare @Date tinyint
  2. set @Date=day(getdate())
  3. select @Date,* from BillBoards 
  4. where day(@Date)-day(Billaboards.BillBoardDate)=20;
Thanks And Records
Apr 22 '14 #3
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

I have no idea what you are trying to do. Your explanations are confusing. Please post some sample data and results.
Apr 22 '14 #4
Luuk
1,047 Expert 1GB
yes, indeed confusing is what he wants... (free after Yoda ;)

But, i think, you might want to do this?:
Expand|Select|Wrap|Line Numbers
  1. SELECT * from BullBoards
  2. WHERE Billaboards.BillBoardDate < DATEADD(dd,-20,getdate())
  3.  
Apr 23 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Zero.NULL | last post by:
Hi, We are using Month-year tables to keep the history of long transaction of our application. For example: We capture the details of a certain action in table...
2
by: smcgrath via AccessMonster.com | last post by:
I have a table listing accounts with a closed date - our Trial balance drops the account after 7 days but our database keeps the record forever - How do I calculate the end of month less 7 days so...
2
by: arulkumara | last post by:
Hi, I want to insert a particular row into a table for every month of beginnging date like 1-11-2007,1-12-2007. for that which one is best triggres or batch jobs. please...
1
by: rahia307 | last post by:
hi i want to create email function every month at 25 date. how can i create it. if any one have any idea about it help me.
9
ddtpmyra
by: ddtpmyra | last post by:
Im using PHP report and I convert the month date into numbers but when I generate and publish it now displaying like this... 1 10 11 2 3 4 5 6 and so forth. How can I make it happen to sor...
7
by: Fannie Dlamini | last post by:
hi guys am creating a leave system in an access form,i want it to add automatically two days to employees every month(thats if the employee has not taken days),for example if today's date was the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.