I just started working with MS SQL Server, i imported my database from MS Access, and now i would like to set the date to a default dd/mm/yy without the time and the 4 digits in the year. I have used getdate()but this gives me full date and time. How can i achieve this? Many thanks for any help.
DAYANAND BURAMSHETTY
Ranch Hand
Joined: Aug 06, 2001
Posts: 34
posted
0
public String sqlDateString() { //U can get system time long time= System.currentTimeMillis(); //It 's convert the system time to java.sql.Date java.sql.Date systemsqldate=new java.sql.Date(time);
String newDate =null; try{ newDate = formatter.format(dateString); }catch(Exception e){ e.printStackTrace(); } return newDate; } If I'm wrong ..correct me
Dil se....,<BR>Dayanand<BR>0065-8839071(off)<BR>0065-7547034(Res0
natx
Greenhorn
Joined: Aug 13, 2001
Posts: 4
posted
0
I think i understand what you want to do, but as i explained in my email this is my second day using ms sql server, and i wouldnt know where to stick all the code, i was thinking i could sort my problem out along these lines CREATE PROCEDURE users_date @MyDate DateTime AS DECLARE @DateOnly DateTime SELECT @DateOnly = CONVERT(DateTime,CONVERT(VARCHAR(8),@MyDate,103)) SELECT * FROM Members, Activity WHERE cp_date = @DateOnly (although i dont know how to connect the procedure with the two date fields in my two tables). Thanks for your help.