PC Review


Reply
Thread Tools Rate Thread

Converting Microsoft Access SQL to Microsoft SQL Server 2005

 
 
Brad Bross
Guest
Posts: n/a
 
      23rd Apr 2009
Good afternoon mavens, would one of you be able to assist this tyro?

I have a successful Microsoft Access SQL that reads
" >Format(Format(Date(),"yyyymmdd"),"General Number") "

Microsoft SQL Server 2005 will not accept it. Would one of you know how to
convert it? Furthermore, would there be a web site any where which would
help me with such conversions in the future? Many thx.

Brad

 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      23rd Apr 2009
Brad

"numbers" are things you can add, subtract, multiply and divide.

Care to explain how you plan to divide a date?

Why do you feel you need to format that date as a "General Number"?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Brad Bross" <(E-Mail Removed)> wrote in message
news:5E4C18B0-ACAF-4AE6-85B7-(E-Mail Removed)...
> Good afternoon mavens, would one of you be able to assist this tyro?
>
> I have a successful Microsoft Access SQL that reads
> " >Format(Format(Date(),"yyyymmdd"),"General Number") "
>
> Microsoft SQL Server 2005 will not accept it. Would one of you know how
> to
> convert it? Furthermore, would there be a web site any where which would
> help me with such conversions in the future? Many thx.
>
> Brad
>



 
Reply With Quote
 
Jellifish
Guest
Posts: n/a
 
      23rd Apr 2009
Not sure why you would want to do this, but if you must, then the following
should work:

(YEAR(GETDATE()) * 10000) + (MONTH(GETDATE()) * 100) + DAY(GETDATE())


"Brad Bross" <(E-Mail Removed)> wrote in message
news:5E4C18B0-ACAF-4AE6-85B7-(E-Mail Removed)...
> Good afternoon mavens, would one of you be able to assist this tyro?
>
> I have a successful Microsoft Access SQL that reads
> " >Format(Format(Date(),"yyyymmdd"),"General Number") "
>
> Microsoft SQL Server 2005 will not accept it. Would one of you know how
> to
> convert it? Furthermore, would there be a web site any where which would
> help me with such conversions in the future? Many thx.
>
> Brad
>



 
Reply With Quote
 
Brad Bross
Guest
Posts: n/a
 
      23rd Apr 2009
Jeff, here is the Access SQL:
SELECT CIMOR_dwvStandardMeansTest.ResponsibilityEndDate
FROM CIMOR_dwvStandardMeansTest
WHERE
(((CIMOR_dwvStandardMeansTest.ResponsibilityEndDate)>Format(Format(Date(),"yyyymmdd"),"General Number")));

What I am attempting to do is look through the column of dates which are
formatted as text YYYYMMDD. Trying to pick out those which are greater than
today's date.

Brad


"Jeff Boyce" wrote:

> Brad
>
> "numbers" are things you can add, subtract, multiply and divide.
>
> Care to explain how you plan to divide a date?
>
> Why do you feel you need to format that date as a "General Number"?
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
> "Brad Bross" <(E-Mail Removed)> wrote in message
> news:5E4C18B0-ACAF-4AE6-85B7-(E-Mail Removed)...
> > Good afternoon mavens, would one of you be able to assist this tyro?
> >
> > I have a successful Microsoft Access SQL that reads
> > " >Format(Format(Date(),"yyyymmdd"),"General Number") "
> >
> > Microsoft SQL Server 2005 will not accept it. Would one of you know how
> > to
> > convert it? Furthermore, would there be a web site any where which would
> > help me with such conversions in the future? Many thx.
> >
> > Brad
> >

>
>
>

 
Reply With Quote
 
Sylvain Lafontaine
Guest
Posts: n/a
 
      23rd Apr 2009
Use the convert function with the format 112 to convert a date to the format
"yyyymmdd":

select convert (char(8), getdate(), 112)

See http://msdn.microsoft.com/en-us/library/ms187928.aspx for more info on
the CAST and the CONVERT functions. The result above will be of type string
but you should be OK for making your comparaison.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Brad Bross" <(E-Mail Removed)> wrote in message
news:5E4C18B0-ACAF-4AE6-85B7-(E-Mail Removed)...
> Good afternoon mavens, would one of you be able to assist this tyro?
>
> I have a successful Microsoft Access SQL that reads
> " >Format(Format(Date(),"yyyymmdd"),"General Number") "
>
> Microsoft SQL Server 2005 will not accept it. Would one of you know how
> to
> convert it? Furthermore, would there be a web site any where which would
> help me with such conversions in the future? Many thx.
>
> Brad
>



 
Reply With Quote
 
Brad Bross
Guest
Posts: n/a
 
      27th Apr 2009
Thx for everyone's replies.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CONNECT MICROSOFT ACCESS TO MICROSOFT SQL SERVER 2008 nirmal k ramdeehul Microsoft Access External Data 1 19th Nov 2009 09:21 PM
CONNECT MICROSOFT ACCESS TO MICROSOFT SQL SERVER 2008 nirmal k ramdeehul Microsoft Access External Data 0 19th Nov 2009 09:53 AM
Can I use Webpart with Microsoft Access to replace sql server 2005 ? TMT32 Microsoft ASP .NET 1 28th Aug 2006 06:43 PM
Microsoft Access 2003 & SQL Server 2005 =?Utf-8?B?SG9zcG8=?= Microsoft Access 3 27th Oct 2005 01:28 AM
Re: Converting Microsoft Word 2000 database to Microsoft Access databa John Nurick Microsoft Access External Data 0 10th Sep 2004 08:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 AM.