#error ????

  • I'm trying to extract a multiple insert script from some data i have in an access database in order to run it on a sql server db (I can REALLY annoyingly only insert data through executing queries because of a basic web interface - so no importing )

    here is my access query:

    SELECT 'INSERT INTO tblJobs (employerId, description, Job_Title, DisciplineId, Date_Created, Your_Reference, Contact, Start_Date, LevelId, CountryId, CountyId,SalaryId,  perm_TempId) VALUES(''some@email.com'', '''+[qryFINAL].[LongDescription]+''', '''+[qryFINAL].[ShortDescription]+''', '+[qryFINAL].[jobTypeId]+', '''+Format([qryFINAL].[datecr],"dd/mm/yy")+''',  '''+[qryFINAL].[YOURREF]+''', '''+[qryFINAL].[Contact]+''', '''+[qryFINAL].[StartDate]+''', '+[qryFINAL].[levelId]+', 1, '+[qryFINAL].[countyId]+', '+[qryFINAL].[salaryId]+', '+[qryFINAL].[PermTempId]+')' AS InsertScript

    FROM qryFINAL

    ORDER BY qryFINAL.DATECR DESC;

    The query executes but all i can see is #error for every record? if anyone can help me at all i'll be very grateful

  • The first thing I think is wrong is that you need to use '&' instead of '+' for concatenation of strings. Also, it is best to put dates into 'dd mmm yyyy' format or 'yyyymmdd' as it is independent of the language of the connection you are using to SQL server (if you are not in the US).

    Regards

    Peter

     

  • Does anything you're referrencing have a bit column without a default value?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply