Showing posts with label compare. Show all posts
Showing posts with label compare. Show all posts

Monday, March 12, 2012

Help needed- regarding datediff functio

Hi,
I have to compare every row in month column in xyz table with current month. If there is mismatch, then error message must be displayed.
I have used DATEDIFF (MM, Select getdate(), select month from xyz ), but I am getting error at MM. Can anybody fix this issue.

The syntax you have is incorrect. Try something like this:

SELECT [Month], Mismatch=CaseWHENMonth(Getdate())= [Month]then 0ELSE 1END

FROM MyTable

|||

This will work:

1SELECT MonthColumn,2 IsMatchColumn =3CaseWHENDatePart(Month,GetDate()) = MonthColumn4Then 0-- Yes (Matched)5Else 1-- No (Not Matched)6END78FROM YourTableName9

Good luck.

Monday, February 27, 2012

Help me with DB schema comparison method

Hi!
can some one help me guide to knwo as to how do we compare teh database schemas of two databases.. i mean in case i have to compare the schema of 2 ole dbs or 2 sql databases then i can do it using teh XML schema \ and compare but then in case i need to compare a SQL schema and a oledb schema then how do i go about it.. since the long datatype in ms access ( using ole db) is text in SQL and tiny int is int16... there are some other discripancies liek that. So how do i go about checking teh database schemas for such disperate DBs. Can soem one tell me some site or give soem guidance in this regard. Please help me as i need it for my project where i need to compare teh schema and alert when they are not compatible.. Please help...thanks in advance..

regards,
GautamDo you have microsoft visio available to you? It can reverse engineer your database to output a great map for you to review.|||hey crispy!!!
That did not help me in anyway...please suggest somethign good... by the way .. i am sorry i did not use visio tool before.

Thanks anyway
Gautam

Sunday, February 19, 2012

help me in retrieving the value

Hi,

thanks for my first post...this is my problem
i have two tables a, b
i wanted to compare the value frm a with b but the probs is the table doesnt repesent the full value in b

eg...table a has value sav
able b has value savyyy

i need to pull this savyyyy frm b table but i dont want to like this
select col_tablea, col_tableb from tablea, tableb where
col_tablea like col_tableb%

this doesnt work i know its wrong without usng
select col_tablea, col_tableb from tablea, tableb where
col_tablea like sav% (i wanted to specify the colname instaead of the word, is it possible)

help me pleaseIs it one to one relationship?|||select col_a,col_b from savvy,savvy1 where savvy1.col_b like savvy.col_a + '%'|||hi ,

thanks a in tons, it really worked..........it was too helpful
thanks once again