Posted on 2003-03-24
Medium Priority
Last Modified: 2008-02-01
Hi, I am new to SQL...Could some one please tell me how I can make this statement work in MS-SQL...It works fine in Oracle...

INSERT INTO Orders (Id, CustomerID, DateOrdered, DateSupplied) VALUES (6097,  1006, sysdate - 118,  sysdate - 98);

The error I get is ...The name 'sysdate' is not permitted in this context...does MS-SQL recocnise SYSDATE?


Question by:baz_can_fix_it
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 32

Accepted Solution

Brendt Hess earned 200 total points
ID: 8199412
The SQL Server equivalent of SysDate is GetDate():

INSERT INTO Orders (Id, CustomerID, DateOrdered, DateSupplied) VALUES (6097,  1006, GetDate() - 118,  GetDate() - 98)


Author Comment

ID: 8199435
Thank you bhess1 that worked :) cheers

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question