?
Solved

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

Posted on 2011-03-24
5
Medium Priority
?
326 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 1000 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: 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

Technology Partners: 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

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

650 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