Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Placeholders in select statements
Message
 
 
To
23/11/2004 23:26:20
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00964117
Message ID:
00964122
Views:
12
Using CAST() function you can create almost any type of data from the proper string. Also T-SQL does have SPACE() function. Yor SELECT may look like this
SELECT field1, CAST(Null AS datetime) as mydate, space(10) as mytextfield, 
       CAST(0 AS int), ...
>Even for you that was impressively fast <g>
>
>I understand using CAST() for datatype conversions, but I am asking more how you create blank fields in a select statement.
>
>If I want a blank text field in VFP it is SPACE(n)
>can't find an equivalent SQL function
>
>Or do I just say NULL as mytextfield ? I actually want to give it a length.
>
>And of course not having the ability to have a blank date is a bit confusing still
>
>
>>It would be CAST() function which you'll be able to use in VFP9 as well. Just keep in mind that SQL Server doesn't support empty dates so you'll have to use Nulls.
>>
>>>I think the reason I'm having trouble finding this in my SQL books is I don't know what to call them.
>>>
>>>In VFP I could say
>>>
>>>SELECT field1, {} as mydate, guid() as myguid, space(10) as mytextfield
>>>
>>>etc.
>>>
>>>What are the SQL equivalents whenn writing remote view code? And what do you call these 'phoney fields' in a select statement ?
>>>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform