from the database. The field Date_Fin_Membre returns me this result
even if the query stipulates
WHERE (dbo.Membre.Date_Fin_Membre = CONVERT(Char(10),
dbo.Membre.Date_Fin_Membre, 101)). I have also tried other types of
conversion without any success.
thanksI haven't worked with OLE automation in Office in some time, but can't
you specify the field type in Word? It soulnd like it's looking for a
date/time formatted field in Word.
HTH,
Stu|||Fernand St-Georges (fernand.st-georges@.videotron.ca) writes:
> This is the result I get in Word as I handle a document that merges data
> from the database. The field Date_Fin_Membre returns me this result
> even if the query stipulates
> WHERE (dbo.Membre.Date_Fin_Membre = CONVERT(Char(10),
> dbo.Membre.Date_Fin_Membre, 101)). I have also tried other types of
> conversion without any success.
Maybe you could explain what's wrong with the result? Maybe it's an
error to you that the end date for a member is in the future, but I
don't know your business.
If you are talking about the time portion, then the WHERE clause is not
the place to handle it.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland, What i believe his problem is,
when he is trying to show date like "07/26/2005" while he is getting
"2006-07-26 00:00:0"
He is not converting the same date in the SELECT list
Mistakingly, he is doing something like this:
Select dbo.Membre.Date_Fin_Membre, Col2, Col3, ......
WHERE (dbo.Membre.Date_Fin_Membre = CONVERT(Char(10),
dbo.Membre.Date_Fin_Membre, 101)).
insteed of
Select CONVERT(Char(10), dbo.Membre.Date_Fin_Membre, 101), Col2, Col3,
......
WHERE (dbo.Membre.Date_Fin_Membre = CONVERT(Char(10),
dbo.Membre.Date_Fin_Membre, 101)).|||Zero.NULL (manish19@.gmail.com) writes:
> Erland, What i believe his problem is,
> when he is trying to show date like "07/26/2005" while he is getting
> "2006-07-26 00:00:0"
Of course, we could start some betting on what output Fernand really
wants. I think my odds are better. 2006-07-26 is a well-formatted date,
and complies with international standards. 07/26/2005 does not even look
like a date to most people in this world. I seem to recall that there
is one country where they use this format, but Fernand does not seem
to live there.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||That's right, we can only think about the possible situation on the
basis of provided data, and I have got this idea just because of style
of conversion Fernand used to compare dates.
In Where clause he used CONVERT(Char(10), dbo.Membre.Date_Fin_Membre,
101)), which converts date in char in mm/dd/yy format, but at the same
time he did not provide the information of what kind of conversion he
is using in Select List for this date column. He is puzzled with the
kind of result he is getting for this date column but did not written
what kind of result he has expected. That is what I am suspecting here
that his date display requirement is the same as he did in where clause.|||Hi Fernand St-Georges
Can you please explain ur problem. Please let us know, whats the
expected result and how the system is behaving now
best Regards,
Chandra
http://groups.msn.com/SQLResource/
http://chanduas.blogspot.com/
------------
*** Sent via Developersdex http://www.developersdex.com ***
No comments:
Post a Comment