General discussion

Locked

Moving Access Queries to SQL Server

By cdailey ·
I am in the process of moving an access 2000 database to SQL Server. I was able to move the SQL code from most of the queries into SQL server and create views, but several of the queries have embedded VB statements (mostly iif statements or datepart function) and wouldn't move over. What is the best way to recreate these in SQL Server so that I can get to them through my web site?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Moving Access Queries to SQL Server

by ohJani In reply to Moving Access Queries to ...

u have to do it one by one, change all the datepart function to CONVERT function sql server. and also dun forget the wild card search "*", sql server uses "%".

Collapse -

Moving Access Queries to SQL Server

by cdailey In reply to Moving Access Queries to ...

The question was auto-closed by TechRepublic

Collapse -

Moving Access Queries to SQL Server

by macbeth In reply to Moving Access Queries to ...

For iif statements use CASE.
SELECT CASE
WHEN state = 'WA' THEN 'Near the Indian Ocean'
WHEN state = 'QLD' THEN 'Near the Pacific Ocean
ELSE 'Dunno where we are'
FROM MyTable

Collapse -

Moving Access Queries to SQL Server

by cdailey In reply to Moving Access Queries to ...

The question was auto-closed by TechRepublic

Collapse -

Moving Access Queries to SQL Server

by cdailey In reply to Moving Access Queries to ...

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums