Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2003, 06:22 PM
Authorized User
 
Join Date: Jun 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default ms sql, need help

Can anyone tell me what the following query means?
I need to translate some of these ms sql tables to mysql.

Thanks
-------------

"SELECT SUN_DB,ACCNT_CODE, ACCNT_NAME, ANAL_A1, ANAL_A2, ANAL_A7, BAD_DEBTOR_FLAG, CONVERT(VARCHAR,DATE_FOR_ACTION,103) AS DATE_FOR_ACTION FROM SSRFACC WHERE ACCNT_CODE='" & strID & "'"
 
Old November 2nd, 2003, 10:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

It looks likes a character string which will ultimately be executed as an SQL query which will SELECT several columns from the SSRFACC table, including a datetime column named DATE_FOR_ACTION. This column will be presented as a variable length character string with the datetime value converted to DD/MM/YYYY format. This converted character string column will be named DATE_FOR_ACTION in the resultset. The query will select the rows whose ACCNT_CODE is equal to the contents of the local variable (in the client code which is generating the query string) named 'strID' at the time the line generating this query string was executed in the client.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old November 2nd, 2003, 11:03 PM
Authorized User
 
Join Date: Jun 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot Jeff, it was a very detailed description. I shouldn't have pasted the entire query.. what I really wanted to ask is this part:

CONVERT(VARCHAR,DATE_FOR_ACTION,103) AS DATE_FOR_ACTION

from what u've explained, I can understand the effect of this line now, but how can I represent the same thing in mysql?

Thanks
 
Old November 3rd, 2003, 07:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can't help you there - you might try asking in the 'mySQL' forum...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old June 16th, 2005, 12:34 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi:)

I think it may sorted out your issuess.

Sample Query In mySQL
SELECT DATE_FORMAT(date_column_name, '%Y/%m/%d') from table_name.








Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
Converting from MS SQL 2005 to Sql Epress edition saif44 SQL Language 0 February 16th, 2007 04:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.