Solved

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

Posted on 2011-03-24
5
318 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
  • 3
  • 2
5 Comments
 
LVL 40

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 40

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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