![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am getting this error when insert values from one table to another in the first table the values are varchar (10). In the second they are datetime. The format of the data is mm/dd/yyyy to be easily converted to dates. The conversion in this case is implicit as indicated in SQL Server documentation. Here is my query: |
|
INSERT INTO Campaign (CampaignID, Name, DateStart, DateEnd, ParentID, ListID) SELECT mysqlfactiva.dbo.campaigns.campaign_id AS CampaignID, mysqlfactiva.dbo.campaigns.campaign_name AS Name, MIN(mysqlfactiva.dbo.programs.start_date) AS DateStart, MIN(mysqlfactiva.dbo.programs.end_date) AS DateEnd, NULL AS ParentID, NULL AS ListID FROM mysqlfactiva.dbo.campaigns, mysqlfactiva.dbo.programs |
|
As soon as I use union I get the above error. This is very strange since even when I execute the query using first union where the dates come from the same table 'programs' I get the error. Why I can insert from programs first time and can's second time? |
![]() |
| Thread Tools | |
| Display Modes | |
| |