|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
differences between ORACLE and MS SQL1) this queery in ORACLE-SQL works fine , in MS-SQL? SELECT code_card, card_date + 31 FROM card i searce and find out that i must use "DATEADD ( datepart , number, date )" but how? 2) this queery in ORACLE-SQL works fine , in MS-SQL? SELECT card_dates, SUM(card_quantity) FROM card_transactios GROUP BY card_dates i want to return my the sumarize but if i have 2 card_transactions in febrary it return to me both of them what i am doign wrong? 3) i want to find all card_transaction for month "may" i must write " LIKE '*/6/2002' " but it returns me an error "your entry cannot be converted to a valid daytime value 4) store procedure is like triggers in ORACLE-SQL? 1. SELECT code_card, DATEADD(dd,31,card_date) AS Card_Date
FROM card Please note that if you want to add a month then use mm and 1 instead of dd and 31. 2. I don't understand what you are after since there is no Card_Transaction column in your example. 3. Use BETWEEN with the first day of the month and the first day of the next month as the arguments. See BETWEEN in BooksOnLine. Or use >= and < . Also look at these to see how to handle dates properly in SQL Server. http://www.karaszi.com/SQLServer/info_datetime.asp Guide to Datetimes http://www.sqlservercentral.com/columnists/bsyverson/sqldatetime.asp Datetimes http://www.murach.com/books/sqls/article.htm Datetime Searching 4. I don't know what you are asking here? A stored procedure is not hte same as a trigger. SQL Server has both. -- Show quoteAndrew J. Kelly SQL MVP "evagelos" <evagelos***@hotmail.com> wrote in message news:uzOKRtO$EHA.2012@TK2MSFTNGP15.phx.gbl... >i want to create some queerys in MS-SQL > > 1) > this queery in ORACLE-SQL works fine , in MS-SQL? > SELECT code_card, card_date + 31 > FROM card > > i searce and find out that i must use "DATEADD ( datepart , number, > date )" > but how? > > 2) > this queery in ORACLE-SQL works fine , in MS-SQL? > SELECT card_dates, SUM(card_quantity) > FROM card_transactios > GROUP BY card_dates > > i want to return my the sumarize but if i have 2 card_transactions in > febrary it return to me both of them > what i am doign wrong? > > 3) > i want to find all card_transaction for month "may" > i must write " LIKE '*/6/2002' " > but it returns me an error "your entry cannot be converted to a valid > daytime value > > 4) store procedure is like triggers in ORACLE-SQL? > > do not cross post!
> this queery in ORACLE-SQL works fine , in MS-SQL? in ms-sql as the same 1) 2)> SELECT code_card, card_date + 31 > FROM card > > i searce and find out that i must use "DATEADD ( datepart , number, date )" > but how? > 2) > this queery in ORACLE-SQL works fine , in MS-SQL? > SELECT card_dates, SUM(card_quantity) > FROM card_transactios > GROUP BY card_dates > i want to return my the sumarize but if i have 2 card_transactions in use datediff> febrary it return to me both of them > what i am doign wrong? why? >3) > i want to find all card_transaction for month "may" > i must write " LIKE '*/6/2002' " > but it returns me an error "your entry cannot be converted to a valid > daytime value or between '1/6/2002' and '30/6/2002' You might want to check
http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part2/c0761.mspx as well. Show quote "evagelos" <evagelos***@hotmail.com> wrote in message news:uzOKRtO$EHA.2012@TK2MSFTNGP15.phx.gbl... > i want to create some queerys in MS-SQL > > 1) > this queery in ORACLE-SQL works fine , in MS-SQL? > SELECT code_card, card_date + 31 > FROM card > > i searce and find out that i must use "DATEADD ( datepart , number, date )" > but how? > > 2) > this queery in ORACLE-SQL works fine , in MS-SQL? > SELECT card_dates, SUM(card_quantity) > FROM card_transactios > GROUP BY card_dates > > i want to return my the sumarize but if i have 2 card_transactions in > febrary it return to me both of them > what i am doign wrong? > > 3) > i want to find all card_transaction for month "may" > i must write " LIKE '*/6/2002' " > but it returns me an error "your entry cannot be converted to a valid > daytime value > > 4) store procedure is like triggers in ORACLE-SQL? > > |
|||||||||||||||||||||||