Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2007, 10:12 AM
Friend of Wrox
 
Join Date: Sep 2005
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


 
Old February 2nd, 2007, 11:46 AM
Friend of Wrox
 
Join Date: Mar 2004
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





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





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