Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
shawnrye2013
Starting Member
1 Post |
Posted - 2013-07-08 : 09:28:20
|
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 |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2013-07-09 : 02:45:39
|
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 = 0SCe-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mutsabinWeb |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-09 : 03:03:35
|
=False should be ='False' in T-SQL assuming its string valueif its booelan value its represented as bit in sql server and use = 0------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-07-20 : 12:38:12
|
[code]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';[/code] Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
sigmas
Posting Yak Master
172 Posts |
Posted - 2013-07-21 : 09:32:38
|
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 |
|
|
|
|
|
|
|