Comparing a DATETIME field and DATE field

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Comparing a DATETIME field and DATE field

Postby ralindblom » Fri Aug 31, 2012 3:07 pm

Is there any way of comparing a DATETIME field and DATE field? The time field has 00:00:00.000 so I really am just looking to compare the date portion of both fields.
ralindblom
 
Posts: 3
Joined: Tue Jun 19, 2007 2:42 pm

Postby Manfred.Castro » Fri Aug 31, 2012 6:46 pm

You should have no problem comparing a DATETIME field and DATE field.
http://www.red-gate.com/supportcenter/Content/SQL_Data_Compare/help/10.0/SDC_Which_Data_Types_Can_Be_Compared
You can try to set up a view in the source DB and compare to that instead, so there's more control over how the info is presented.
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby ralindblom » Fri Aug 31, 2012 6:54 pm

While the compare happens every items comes back as a difference. I would like to have a date such as 2012-12-31 be shown to equal 2012-12-31 00:00:00.000. Currently they show up as mismatches.
ralindblom
 
Posts: 3
Joined: Tue Jun 19, 2007 2:42 pm

Postby Manfred.Castro » Fri Aug 31, 2012 7:52 pm

You can try using a view to manipulate the data and compare against the view.
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest