Yes, it's set up to be a Text output.
Main Topics
Browse All TopicsI have a calculation that takes this information from another field: 5/11/2006 10:27 AM
and converts it to: {ts '2006-5-11 10:27:0'}
Here's the calculation:
"{ts '" & Year (fDate_Modified_GREATEST) & "-" &
Month (fDate_Modified_GREATEST) & "-" &
Day ( (fDate_Modified_GREATEST))
Hour (fDate_Modified_GREATEST) & ":" &
Minute (fDate_Modified_GREATEST) & ":" &
Seconds (fDate_Modified_GREATEST) & "'}"
In the above example, it returned records with the following timestamps (data represented exactly how it is on SQL server, format and all)...
5/11/06 9:58 AM
5/11/06 1:35 PM
5/11/06 10:36 AM
5/11/06 12:55 PM
5/11/06 8:43 AM
5/11/06 9:37 AM
5/11/06 12:50 PM
5/11/06 10:39 AM
5/11/06 8:30 AM
5/11/06 2:01 PM
5/11/06 10:27 AM
What's going on here?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
http://www.lesouef.net/fil
to show you my way which works... to compare with yours
The calculation is inserted into an SQL query, so it ends up looking like this in the SQL Query...
SELECT * FROM "Members" WHERE "Members"."Date_modified" > {ts '2006-5-11 10:27:0'}
I'm thinking that the SQL query and my Filemaker calculations are correct. I just wonder if there's something wrong with the SQL data and the way it's formatted. I've been told that to do an SQL query based on a timestamp, that {ts '2006-5-11 10:27:0'} is the way it needs to be formatted. However, on the other end (in the SQL database), it's formatted like this: 5/11/06 10:27 AM.
sorry, I missed the fact you wanted to get this back from a SQL server, I thought you were just saying it looks like, etc...
I have no SQL server here, and this may vary according to SQL server type (MS?).
It is probably related to the date/time conversion setting of your odbc driver if it has one. If you query a time field, how does it look like?
>I've been told that to do an SQL query based on a timestamp, that {ts '2006-5-11 10:27:0'} is the way it
>needs to be formatted.
True. This Timestamp format...
{ts '2006-5-11 10:27:0'}
is what's called an escape sequence. It's got nothing to do with the format of the DATETIME value returned by the SQL server in the query results, however. The purpose of this string is to allow software to use a single, standardized format for timestamps regardless of what format the individual databases are using.
>However, on the other end (in the SQL database), it's formatted like this: 5/11/06 10:27 AM.
Actually, this formatting isn't in the SQL database, it's happening when the data is displayed.
In the database itself, the date and time information is stored as numeric data, and converted into a format that makes sense to people only when it's displayed.
If you want to change how the date and time are formatted when returned, you can use the CONVERT() function in your query. This will change the Datetime field into a text string, and apply one of a number of predefined formats to it. For example, instead of doing
SELECT "SomeDate" FROM "MyTable"
you might do this:
SELECT CONVERT(varchar, "SomeDate", 120) as "MyFormattedDate"
The number 120 is a "format ID" that tells SQL Server how you want the date formatted. Here's more information on this somewhat confusing function.
http://msdn.microsoft.com/
Business Accounts
Answer for Membership
by: jvaldesPosted on 2006-05-11 at 12:53:26ID: 16662051
When you created the calculation field , did you set the type to Text? If you were to output the string in Filemaker what would it contain? Of all the delimiters you used in your string I have only had problems with the "-".
Let me know what you find...
Jvaldes