SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Ms-Access Sql to T-sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shawnrye2013
Starting Member

USA
1 Posts

Posted - 07/08/2013 :  09:28:20  Show Profile  Reply with Quote
I have to following
WHERE (((tblExsitingEEs.ProfessionalLicense)="RN") AND ((tblExsitingEEs.LicenseExpiration)<Date()-"60" Or (tblExsitingEEs.LicenseExpiration) Is Null)) and (tblExsitingEEs.status='1-Current Employee')

WHERE (((tblExsitingEEs.[30DayReview])=False) AND ((tblExsitingEEs.DateOfHireRehire)<Date()-30)) and (tblExsitingEEs.status='1-Current Employee')

and I am getting errors becuase I am trying to use this in a Dataset and it is looking for the t-sql version.
How can I convert from ms-access sql to t-sql?


shawn

Edited by - shawnrye2013 on 07/08/2013 09:29:10

stepson
Constraint Violating Yak Guru

Romania
431 Posts

Posted - 07/09/2013 :  02:45:39  Show Profile  Reply with Quote
Hi,

First Where :


WHERE (((tblExsitingEEs.ProfessionalLicense)='RN') 
	AND (DATEDIFF(d,tblExsitingEEs.LicenseExpiration,GETDATE())<60
	OR (tblExsitingEEs.LicenseExpiration) Is Null)) 
        AND (tblExsitingEEs.status='1-Current Employee')


The second Where:

WHERE (((tblExsitingEEs.[30DayReview])=False) 
	AND (DATEDIFF(d,tblExsitingEEs.DateOfHireRehire,GETDATE())<30)) 
	AND (tblExsitingEEs.status='1-Current Employee')



about
tblExsitingEEs.[30DayReview])=False

what kind of type is the column 30DayReview ? You can use =False or = 0



S

Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut
sabinWeb
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 07/09/2013 :  03:03:35  Show Profile  Reply with Quote
=False should be ='False' in T-SQL assuming its string value

if its booelan value its represented as bit in sql server and use = 0

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs

Edited by - visakh16 on 07/09/2013 03:03:49
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30249 Posts

Posted - 07/20/2013 :  12:38:12  Show Profile  Visit SwePeso's Homepage  Reply with Quote
WHERE	tblExsitingEEs.ProfessionalLicense = "RN"
	AND (tblExsitingEEs.LicenseExpiration < DATEADD(DAY, -60, GETDATE()) OR tblExsitingEEs.LicenseExpiration Is Null)
	AND tblExsitingEEs.[Status]= '1-Current Employee';

WHERE	tblExsitingEEs.[30DayReview] = 0
	AND tblExsitingEEs.DateOfHireRehire < DATEADD(DAY, -30, GETDATE())
	AND tblExsitingEEs.[Status] = '1-Current Employee';



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

sigmas
Posting Yak Master

Belarus
172 Posts

Posted - 07/21/2013 :  09:32:38  Show Profile  Reply with Quote
quote:
Originally posted by SwePeso

WHERE	tblExsitingEEs.ProfessionalLicense = "RN" 'RN'
	AND (tblExsitingEEs.LicenseExpiration < DATEADD(DAY, -60, GETDATE()) OR tblExsitingEEs.LicenseExpiration Is Null)
	AND tblExsitingEEs.[Status]= '1-Current Employee';

WHERE	tblExsitingEEs.[30DayReview] = 0
	AND tblExsitingEEs.DateOfHireRehire < DATEADD(DAY, -30, GETDATE())
	AND tblExsitingEEs.[Status] = '1-Current Employee';



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA


fixed the typos

Edited by - sigmas on 07/21/2013 09:34:59
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000