Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to convert access SQL to SQL in iSQlW

 
   Database Forums (Home) -> MSEQ RSS
Next:  owa_cookie and owa_custom interaction  
Author Message
Mark

External


Since: Mar 16, 2006
Posts: 66



(Msg. 1) Posted: Thu Nov 06, 2008 3:01 pm
Post subject: How to convert access SQL to SQL in iSQlW
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

Hello all,

I have a query that works in access, but I would like to run it in iSQLW. I
have a few syntax errors. can anyone help?

SELECT SHIP_ZONE AS [Pool Point], Count(*) AS Total
FROM (SELECT DISTINCT ship_zone, nest_to_cont FROM VIAWARE_WCS_TO_VIA_T
WHERE TRANS_STT='01' And (((DTIMECRE) Between #10/27/2008# And #11/2/2008#)))
AS x
GROUP BY SHIP_ZONE
ORDER BY Count(*) DESC;

 >> Stay informed about: How to convert access SQL to SQL in iSQlW 
Back to top
Login to vote
Russell Fields

External


Since: Feb 21, 2007
Posts: 457



(Msg. 2) Posted: Fri Nov 07, 2008 10:50 am
Post subject: Re: How to convert access SQL to SQL in iSQlW [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark,

Access SQL does not always convert readily to TSQL. Different dialects,
different solutions. The only way to get a good translation is to do it
yourself.

However, in the current piece of code, if you replace the # around the dates
with single quotes, '10/27/2008' And '11/2/2008', it will parse correctly
and it looks like it will run correctly.

By the way, your date format is locale specific. A date that will be
recognized by any locale (or, in SQL Server: language) is YYYYMMDD. Just in
case that matters to you.

RLF

"Mark" wrote in message

> Hello all,
>
> I have a query that works in access, but I would like to run it in iSQLW.
> I
> have a few syntax errors. can anyone help?
>
> SELECT SHIP_ZONE AS [Pool Point], Count(*) AS Total
> FROM (SELECT DISTINCT ship_zone, nest_to_cont FROM VIAWARE_WCS_TO_VIA_T
> WHERE TRANS_STT='01' And (((DTIMECRE) Between #10/27/2008# And
> #11/2/2008#)))
> AS x
> GROUP BY SHIP_ZONE
> ORDER BY Count(*) DESC;
>

 >> Stay informed about: How to convert access SQL to SQL in iSQlW 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
newbie: how convert nvchar to datetime? - I have imported a table into msSQL (2000) One of the fields which was stored originally as a simple date field (05/05/05) was created as nvarchar(8). How to I alter this column to become a DateTime field type? I want to do this before I add any more..

question on date (or string after using convert function) .. - select case when '02/12/2005' >= '01/02/2006' then 'T' else 'F' end the result return is 'T' why?? (2005 should be < 2006)

Query an Access MDB file from SQL Server - We have a password protected split Access database on our company domain, this database contains a particular report that one of the company directors likes to see every week. However said director is rarely on site and has requested that the report i...

Conditional query criteria in Access 2003 with SQL Server BE - Hello: I just upsized an Access 2003 application to a SQL Server 2000 back end. There is a query that worked fine before the upsize, but does not work now. The purpose of the query is to give me a list of employees that are scheduled to work today. ...

EXEC (select... ) problem Help! - How can I get this to work? declare @WkEmpID declare @sql varchar(1000) set @sql = 'select distinct @WkEmpID = EmpID from Employee' exec (@sql) Now this is a simplified version of a more comples query which is forcing me to use this method rather than...
   Database Forums (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]