Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Convert Access 2003 Function
I am converting an Access DB to SQL2000 and opne of the queries uses the
Format$ function.  How should the syntax be for SQL?

Access:   Format$(TimeTrackerE
ntry.EntryDate,'yyyymm') AS EntryMonth

Report this thread to moderator Post Follow-up to this message
Old Post
dj5md
09-30-05 06:23 PM


Re: Convert Access 2003 Function
Use the CONVERT function with an optional date style argument.  See the
following for syntax, samples and date arguments.

http://msdn.microsoft.com/library/d...br />
2f3o.asp

HTH

Jerry
"dj5md" <dj5md@discussions.microsoft.com> wrote in message
news:073E808D-100D-4F1F-9842- 4BEB4DF3F112@microso
ft.com...
>I am converting an Access DB to SQL2000 and opne of the queries uses the
> Format$ function.  How should the syntax be for SQL?
>
> Access:   Format$(TimeTrackerE
ntry.EntryDate,'yyyymm') AS EntryMonth



Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Spivey
09-30-05 06:23 PM


Re: Convert Access 2003 Function
Thanks Jerry, I already looked at Cast and Convert but cannot figure out the
correct syntax.  It's a bit confusing for me.

"Jerry Spivey" wrote:

> Use the CONVERT function with an optional date style argument.  See the
> following for syntax, samples and date arguments.
>
> http://msdn.microsoft.com/library/d... />
o_2f3o.asp
>
> HTH
>
> Jerry
> "dj5md" <dj5md@discussions.microsoft.com> wrote in message
> news:073E808D-100D-4F1F-9842- 4BEB4DF3F112@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
dj5md
09-30-05 06:23 PM


Re: Convert Access 2003 Function
Try this:

SELECT  LEFT(CONVERT(VARCHAR
 (25),GETDATE(),112),
6)

HTH

Jerry
"dj5md" <dj5md@discussions.microsoft.com> wrote in message
news:8212D4FC-A530-47DC-9E07- 934516904C6D@microso
ft.com...
> Thanks Jerry, I already looked at Cast and Convert but cannot figure out
> the
> correct syntax.  It's a bit confusing for me.
>
> "Jerry Spivey" wrote:
> 



Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Spivey
09-30-05 06:23 PM


Re: Convert Access 2003 Function
Thats was it.  I changed the GetDate with my DB field and removed the Select
and it worked with no problems.  Thanks much Jerry.  I also understand the
function better now that I have the correct syntax.

"Jerry Spivey" wrote:

> Try this:
>
> SELECT  LEFT(CONVERT(VARCHAR
 (25),GETDATE(),112),
6)
>
> HTH
>
> Jerry
> "dj5md" <dj5md@discussions.microsoft.com> wrote in message
> news:8212D4FC-A530-47DC-9E07- 934516904C6D@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
dj5md
09-30-05 06:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 02:28 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006