SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

11 Posts

Posted - 11/16/2006 :  12:51:44  Show Profile
Hello all. I know some of the basics, but I am by no means a guru like alot of the people here, and I'm learning by fire! lol Here's a question that will problably be a breeze to you guys. I have a spec they want a query for, but I'm not sure where to start. I found a command called SET DATEFORMAT, but not really sure how to use it, or if it's even waht I need. Anyway here's what I was given to work from. I'd appreciate ay help you can give:

This interface service describes how to populate the EFFDT field in the Project_7 table for a GL record.

Input Parameter: G01.Acc_Eff_DT

Reference table: G01

1. If the code is being run for the first time return ‘2006-12-21’.
2. Else if the current day of the week is Thursday return the date in the format of ‘YYYY-MM-DD’.
3. Else return the date of the next Thursday in the format of ‘YYYY-MM-DD’.

Edited by - ajr on 11/16/2006 13:02:54

Not Just a Number

15586 Posts

Posted - 11/16/2006 :  13:02:52  Show Profile
Got Books online?

Also you talk about insert/update, and then discuss "return"

What excatly do you have to do...

I suspect you want to do

SELECT REPLACE(CONVERT(char(10),GetDate(),102),'.','-')

Just replace GetDate with your column

But this really is a presentation issue...I ithink..you don't need to worry about formatting dates in sql server



Hint: Want your questions answered fast? Follow the direction in this link

Add yourself!

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000