473,491 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

insert data type smalldatetime

jamesd0142
469 Contributor
i have a column in my database called passwordchanged of datatype smalldatetime(4)

i want to add a record to this with the format 'DD/MM/YYYY' how can i do this?
Oct 25 '07 #1
4 6641
amitpatel66
2,367 Recognized Expert Top Contributor
i have a column in my database called passwordchanged of datatype smalldatetime(4)

i want to add a record to this with the format 'DD/MM/YYYY' how can i do this?

You need to alter your table and increase the size of the column so that is can hold the date value in the format 'dd/mm/yyyy'
Oct 25 '07 #2
jamesd0142
469 Contributor
You need to alter your table and increase the size of the column so that is can hold the date value in the format 'dd/mm/yyyy'
there is already data in the field in that format (dd/mm/yyyy) which is put there by another programme.

This is why im so confused,
Oct 25 '07 #3
amitpatel66
2,367 Recognized Expert Top Contributor
there is already data in the field in that format (dd/mm/yyyy) which is put there by another programme.

This is why im so confused,
James,

In that case why dont you try inserting the data. POST back in case if it generates any error.
Oct 25 '07 #4
jamesd0142
469 Contributor
i managed to find the answer,

Expand|Select|Wrap|Line Numbers
  1. (select convert(varchar(20), convert(datetime, getdate()), 101)
  2.  
Full code is
Expand|Select|Wrap|Line Numbers
  1. declare @a varchar(20)
  2. Set @a = (select convert(varchar(20), convert(datetime, getdate()), 101))
  3. update Users
  4. SET [Password] = DD3_Password, PasswordChanged = @a
  5. from temptable2
  6. where Users.Login = temptable2.Login
  7.  
cheers
Oct 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4697
by: David McManus | last post by:
I am trying to use a query to filter SQL Server 2000 records by a date value. Here is relevant columns in my database table (tblContent): title starting .... and here is my query: Query...
2
16052
by: ImraneA | last post by:
Hi there Application : Access v2K/SQL 2K Jest : Using sproc to append records into SQL table Jest sproc : 1.Can have more than 1 record - so using ';' to separate each line from each other.
18
10244
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the...
0
4469
by: ImraneA | last post by:
Hi there I had pleasure of upsizing Access v97 db to Access v2K/SQL 2K. Wish to provide some knowledge gained back to community - hopefully help others. 1.Question how do you test stored...
1
3064
by: patrick | last post by:
I have tried using 2 type systems to get this to compile but it still gets the same error: Public MustInherit Class _Applications Private _AppID As System.Decimal Private _AppPosition As...
0
3681
by: Scarab | last post by:
Hi all, When I use following sql to get data in stored procedure, error occurs: insert into #tmp EXECUTE dbo.prc_1 @date1,@date1 Here is the source code, Thanks CREATE TABLE ( NULL , ...
9
2259
by: rhaazy | last post by:
Using MS SQL 2000 I have a stored procedure that processes an XML file generated from an Audit program. The XML looks somewhat like this: <ComputerScan> <scanheader>...
9
1361
by: Guy Cohen | last post by:
Hi all as part of Insert I use Now() The type in the database is shortdatetime. What is the correct format to insert now()? Guy
1
1894
jamesd0142
by: jamesd0142 | last post by:
sql server 2000 declare @a varchar(20) Set @a = (select CONVERT(CHAR(10),GETDATE(),103)) update Users SET = DD3_Password, PasswordChanged = @a from temptable2 where Users.Login =...
1
1930
by: Madmartigan | last post by:
Hi I have a question from college that requires me to write a script that will copy data from an existing table into 4 related tables. The related tables have been created from normalisation. The...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.