Convert ACCESS code to SQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sachinkale123
    New Member
    • Jul 2007
    • 37

    #1

    Convert ACCESS code to SQL Server

    Hi,
    I m working on the project which was using MS Access but now i want to use SQL Server 2005.
    But there are some queries which are not understood by me, so please help me in converting those.
    Following is the query:

    SHAPE {select stlcode , SampleTypeCode, InNo,NoOfSample s,RecdDistrict, RecdTal,DtRecd , RecdFrom, RecdNameDesg, PrimaryInNo, MicroInNo, WaterInNo from SInward order by SampleTypeCode, InNo } AS ParentCMD APPEND
    ({select SampleType, InNo, SrNo, StlCode, AStlCode, SampleTakenDt, FarmerNm, FarAddVil, FarAddPost, FarAddDist, FarAddTal , FarAddPin, SurveyGrNo, ReprArea, LastSeason, LastSeasonCrop, NextSeason, NextSeasonCrop, NextSeasonCrop2 2, AgeOfTree, LandProfile, DepthFrom, DepthTo, WaterSource, CollectdBy, SampleAccepted, LabSampleNo, HCNumber, MicroLabSampleN o, WaterLabSampleN o from SDetails order by SrNo } AS ChildCMD RELATE SampleTypeCode TO SampleType, InNo to InNo, stlcode to stlcode) AS ChildCMD

    This query was previously written in MS Access and now I want it to be in SQL Server 2005, So please help me in solving this.
    Thanx
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by sachinkale123
    Hi,
    I m working on the project which was using MS Access but now i want to use SQL Server 2005.
    But there are some queries which are not understood by me, so please help me in converting those.
    Following is the query:

    SHAPE {select stlcode , SampleTypeCode, InNo,NoOfSample s,RecdDistrict, RecdTal,DtRecd , RecdFrom, RecdNameDesg, PrimaryInNo, MicroInNo, WaterInNo from SInward order by SampleTypeCode, InNo } AS ParentCMD APPEND
    ({select SampleType, InNo, SrNo, StlCode, AStlCode, SampleTakenDt, FarmerNm, FarAddVil, FarAddPost, FarAddDist, FarAddTal , FarAddPin, SurveyGrNo, ReprArea, LastSeason, LastSeasonCrop, NextSeason, NextSeasonCrop, NextSeasonCrop2 2, AgeOfTree, LandProfile, DepthFrom, DepthTo, WaterSource, CollectdBy, SampleAccepted, LabSampleNo, HCNumber, MicroLabSampleN o, WaterLabSampleN o from SDetails order by SrNo } AS ChildCMD RELATE SampleTypeCode TO SampleType, InNo to InNo, stlcode to stlcode) AS ChildCMD

    This query was previously written in MS Access and now I want it to be in SQL Server 2005, So please help me in solving this.
    Thanx

    That is not simple thing, most of the query you have to change.

    1. Access Date in where clause will be “#” change to “ ‘ “
    2. Access IIF condition, change to Case…Blab blab.

    Comment

    • sachinkale123
      New Member
      • Jul 2007
      • 37

      #3
      Originally posted by hariharanmca
      That is not simple thing, most of the query you have to change.

      1. Access Date in where clause will be “#” change to “ ‘ “
      2. Access IIF condition, change to Case…Blab blab.

      Thanxs for u r reply....
      now i can think that way...

      Comment

      Working...