Solved

Creating a new table from Main table based on date range (two dates)

Posted on 2011-03-24
5
320 Views
Last Modified: 2012-05-11
I have a simple table (tblMain). The table has a date field called DateCreated. I need to know how:

1. How 1 can generate a new table (tblNew) from tblMain for a certain date range (two Dates) and
2. I am new at this method as such, I will appreciate a sample db of suggested solution
 
0
Comment
Question by:bobby6055
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 41

Accepted Solution

by:
Sharath earned 250 total points
ID: 35212165
What is your database? If SQL Server, you can try this?
select *
  into NewTable
  from tblMain
 where DateCreated between '2011-03-01' and '2011-03-23' -- Change these dates to whatever you want

Open in new window

0
 
LVL 3

Author Comment

by:bobby6055
ID: 35219679
Thanks.
I have two other questions opened similar to this one. I will appreciate your assistance on any of the other two questions.
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35219713
Can you post the link for those other questions.
0
 
LVL 3

Author Comment

by:bobby6055
ID: 35219724
0
 
LVL 3

Author Comment

by:bobby6055
ID: 35219736
Here is the second one which I think you would have fun with:
http://www.experts-exchange.com/Microsoft/Applications/Q_26910343.html

I will provide you a sample db if requested
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question