473,386 Members | 1,706 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,386 software developers and data experts.

Simple database export

15
Hi all,

I hope someone can help me.

Running access 03 on win xp.

I have a single table database which contains name, address and last contact date as its fields. The number of records is around 500.

Every now and again I need to run a query that sorts records that where last contacted between 2 dates. When I get this info I manually copy and paste it to excel then use word to make it into a mail merge document for making address labels. I want to design a vb script that would action this automatically. i.e. froma control request 2 dates, upon entry and confirmation the labels are ready to print. To be honest even to get as far as the excel export would be good.

I realise that this is quite a big ask, but even if someone could point me to an article online that could help me out it would be much appreciated.
Dec 18 '06 #1
8 1518
NeoPa
32,556 Expert Mod 16PB
You can start off with a query (I used 'YourTable' as your table name) :
Expand|Select|Wrap|Line Numbers
  1. SELECT [name],[address],[last contact date]
  2. FROM YourTable
  3. WHERE [last contact date] Between [Enter Start of Date Range] And [Enter End of Date Range]
which will return the data required. It will prompt the operator to enter the two dates required.
Dec 20 '06 #2
lostdog
15
You can start off with a query (I used 'YourTable' as your table name) :
Expand|Select|Wrap|Line Numbers
  1. SELECT [name],[address],[last contact date]
  2. FROM YourTable
  3. WHERE [last contact date] Between [Enter Start of Date Range] And [Enter End of Date Range]
which will return the data required. It will prompt the operator to enter the two dates required.
Thank you so much, that was a lot easier than I thought.

Just one more question, can the data be directly mailmerged to a word doc from a query?

Thanks
Dec 28 '06 #3
NeoPa
32,556 Expert Mod 16PB
I expect it can be done in code but I can't help you there I'm afraid.
Dec 28 '06 #4
lostdog
15
No probs, another way I have considered trying is building a macro to export the saved results from the query. Can I modify the above code to save the results in a new table?
Dec 28 '06 #5
NeoPa
32,556 Expert Mod 16PB
Try :
Expand|Select|Wrap|Line Numbers
  1. SELECT [name],[address],[last contact date]
  2. INTO [NewTable]
  3. FROM YourTable
  4. WHERE [last contact date] Between [Enter Start of Date Range] And [Enter End of Date Range]
Dec 30 '06 #6
lostdog
15
Try :
Expand|Select|Wrap|Line Numbers
  1. SELECT [name],[address],[last contact date]
  2. INTO [NewTable]
  3. FROM YourTable
  4. WHERE [last contact date] Between [Enter Start of Date Range] And [Enter End of Date Range]
Thanks, that has solved the problem! Can a make table query be combined into a report? I have got it down to a 2 stage process as in, click 1 Create table, click 2 show report.

Its not a big issue, just curious can it be done
Jan 11 '07 #7
NeoPa
32,556 Expert Mod 16PB
I don't believe you can create a table as well as power a report from the one query.
You could, of course, just use a SELECT query for the report but that would miss out the create table step.
Jan 11 '07 #8
lostdog
15
I don't believe you can create a table as well as power a report from the one query.
You could, of course, just use a SELECT query for the report but that would miss out the create table step.
No worries, thank you for the help
Jan 11 '07 #9

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

Similar topics

3
by: Cristina | last post by:
Hallo i am a beginner into Oracle Technologies.I would like to make backup of my database,but i dont know how.Is there tools?Can i schedule the backup plan? thanks Cristina
3
by: Bennett Haselton | last post by:
I'm working on an ASP.Net project where I want to test code on a local machine using a local database as a back-end, and then export it to the production machine where it uses the hosting...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
1
by: Bridget Willey | last post by:
I am using ACT 6 and am trying to "split" the database between records for customers and junk records. The accounts designated as "customers" have that word in the ID field, and I am using that...
2
by: PC User | last post by:
I have this code from a db of a previous version of access to archive a database, but I'm using A2K and it doesn't seem to work. Can someone help me? Code:...
1
by: DJDoc | last post by:
2 things: 1) there any simple (and I mean REALLY simple cookie cutter) way to export a TEXT format or HTML format document or report out of a single ACCESS record? -Just take a record and...
1
by: davidwelli | last post by:
Hello, I have a Access 200 format database that contains contact details and a picture for each record. The contact details are held in one table and the images are held in another as OLE...
0
by: Vinod Sadanandan | last post by:
STANDBY DATABASE MONITORING & PROTECION MODES (9iR2) This document is written for understanding and monitoring standby database configured with diffrent protection modes . MAXIMUM PROTECTION ...
6
by: mirianCalin | last post by:
i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how.. i've found this instruction on the net but i cant...
0
by: kkshansid | last post by:
i cannot export my sql server database to msaccess database which i usually did successfully 3weeks ago pls help me to find the error so that i can correct it in future error is - Validating...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.