Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2007, 10:12 AM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default Convert SQL to MS Access

Hello everyone

Can anyone help me convert the sql statement below to a statement I can put into Microsoft access, or help me brake this down so I can put it into access.

Thanks
Corey


Code:
 select 'FOX' PLATFORM
       ,dsd.site_id store_id
       ,dsd.locale
       --, x.site_name Store_Name
       , to_char(dsd.reporting_date,'DD') DD
       , to_char(dsd.reporting_date,'MM') MM
       , to_char(dsd.reporting_date,'YYYY') YYYY
       , dsd.requisition_id Order_id
       , dsd.product_id
       , dsd.product_name name
       , dsd.quantity quantity
       --, round(dsd.unit_price,2) product_unit_price
       , round(decode(dsd.reporting_state_type,'SHIPMENT',d sd.price,'RETURN_RECEIPT',-dsd.price,' '),2) Gross_Price
       --xxx, u.price_per_qty_num Product_price
       --xxx, round(((u.price_per_qty_num*ex2.exchange_rate/ex1.exchange_rate)*u.quantity),2) USD_Gross_price
       --xxx, (select name from wkf_state where state_id = t.state_id) Order_Status
       , decode(dsd.reporting_state_type,'SHIPMENT','COMPLE TED','RETURN_RECEIPT','RETURNED',' ') Order_Status
       , dsd.program_id
       , dp.description
       , dp.program_name
       , dp.MEDIA_TYPE
       , dp.PROMOTION_TYPE
from dw_sales_data dsd, dw_programs dp
where dsd.program_id = dp.program_id
and dsd.program_id in ('115)
and to_char(dsd.REPORTING_DATE,'YYYY-MM-DD') between '2006-11-01' and '2006-11-30'
and dsd.reporting_currency = 'USD


Reply With Quote
  #2 (permalink)  
Old February 2nd, 2007, 11:46 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

This is a select statement with the parameters built in. Do you want to keep it that way? How many fields are in the tables?

Here is the basic syntax:

SELECT table.field
FROM table, table, table
WHERE dsd.program_id = dp.program_id
etc.

You will have to say what each of the code words does, like
"in"
"to_char()" (converts date format)

etc.

I think you should build this in the query designer visually instead of trying to convert the SQL, although it is easy enough to do.


mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Ms Access report to MS Word doc kite Access 1 October 22nd, 2007 01:45 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
I am trying to convert a MS Access Query to a SQL? WebLadyBug SQL Server ASP 3 March 9th, 2007 12:39 PM
Convert UNIX Time to MS Access Corey Access 1 January 23rd, 2006 12:32 AM
how to convert ms access db to sql server method SQL Server 2000 1 March 11th, 2005 11:44 PM



All times are GMT -4. The time now is 07:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.